Skip to content
← API documentation

Publishers

SDK integration and user consent

The SDK collects URLs and search queries, so under GDPR (art. 6) and ePrivacy (art. 5(3)) it needs explicit user consent. Until the user presses “Allow”, the SDK creates no identifier, stores no events and contacts no server. Your extension works the same either way.

Manifest V3 Opt-in Shadow DOM

Installation

In the dashboard: Extensions → SDK → “Download”. Download the single .js file and place it in your extension root as intentd.min.js. The file carries your keys and configuration. Do not rename it.

extension root
manifest.json
background.js
popup.html
intentd.min.js        the SDK carrying your extension keys — do not rename
manifest.json
{
  "manifest_version": 3,
  "background": { "service_worker": "background.js", "type": "module" },
  "action": { "default_popup": "popup.html" },
  "permissions": ["storage", "webNavigation", "tabs", "alarms", "unlimitedStorage"],
  "host_permissions": ["https://api.intentd.net/*"]
}
background.js
// background.js — first line, at the top level
import './intentd.min.js';

API

MethodPurpose
IntentD.mountConsent(element) Show the banner in the popup when there is no consent. Promise<boolean>.
IntentD.hasConsent() Whether consent exists for the current text version. Promise<boolean>.
IntentD.getConsentState() 'approved' | 'declined' | null.
IntentD.grantConsent() Record consent (from your own UI).
IntentD.revokeConsent() Withdraw: collection stops, the queue and the installation identifier are deleted.
IntentD.openConsentTab() Open the consent tab (or focus the open one). Reserved for extensions without a popup, which the single-file download does not support yet.
IntentD.status() SDK state, including consent and paused: 'limit_reached' | null.

The decision is stored only in chrome.storage.local of that browser profile: every device asks separately, and the server does not record who consented or when. Only the consent text version travels to the server with each bucket.

When the plan limit is reached

If the plan limit is reached (HTTP 402 SUBSCRIPTION_LIMIT_REACHED), the SDK keeps events queued locally and retries every hour. The extension should call IntentD.status() to detect this and prompt the developer to upgrade.

popup.js
const status = await IntentD.status();
if (status.paused === 'limit_reached') {
  // Events are held in chrome.storage.local and sent after the upgrade.
}
Talk to us