Guides
Publish your first consent form
Configure purposes, publish a version, create a key, set origins, and collect a receipt.
Publish your first consent form
Goal
A published consent version, a publishable key, allowed origins, and at least one receipt.
Prerequisites
- Account, organization, and project (Access)
Steps
Workflow · Consent go-live
- Open the project → Consent.
- Add categories and purposes (at least one required purpose; optional purposes for preference/withdraw flows).
- Edit notice title, description, labels, and company presentation fields.
- Click Publish: creates an immutable consent version. Draft is never served to the SDK.
- Open Develop → Allowed origins and list hosts (e.g.
localhost, production host). New projects enable the allowlist by default. - Open Develop → Create publishable key → copy
pk_live_…once. - Install SDK and call
Accord.initin the browser only with the key and Erasure origin. - Accept the notice in a browser.
- Confirm a row under Receipts.
npm install @erasurehq/accordimport { Accord } from "@erasurehq/accord";
const client = await Accord.init({
publicKey: "pk_live_…",
apiBaseUrl: "https://app.erasurehq.in", // origin only — no /api path
});Optional:
privacyControl: true, floating re-entry chip after decisionclient.showPreferences()/client.withdrawOptional(), optional-purpose updates- Project webhook:
consent.updatedwithX-Accord-Signature(Webhooks)
Verify: banner on first visit → accept → reload with no banner if stored consent valid → Receipts / Develop shows live traffic.
Verify
| Check | Expected |
|---|---|
| Versions | At least one published version |
| Origins | Production host listed if allowlist on |
| Key | Key exists (raw secret only at create time) |
| Receipts | ≥1 receipt after accept |
Common failures
| Symptom | Check |
|---|---|
no_published_version | Publish consent |
origin_not_allowed | Allowed origins |
invalid_key / revoked_key | Key create/revoke |
| No receipts | Network tab POST consent; versionId/hash match |
Next
- SDKs for deeper integration
- Connect PostgreSQL if you need deletion
- DPDP: Consent