ErasureDocs
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

  1. Open the project → Consent.
  2. Add categories and purposes (at least one required purpose; optional purposes for preference/withdraw flows).
  3. Edit notice title, description, labels, and company presentation fields.
  4. Click Publish: creates an immutable consent version. Draft is never served to the SDK.
  5. Open Develop → Allowed origins and list hosts (e.g. localhost, production host). New projects enable the allowlist by default.
  6. Open Develop → Create publishable key → copy pk_live_… once.
  7. Install SDK and call Accord.init in the browser only with the key and Erasure origin.
  8. Accept the notice in a browser.
  9. Confirm a row under Receipts.
npm install @erasurehq/accord
import { 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 decision
  • client.showPreferences() / client.withdrawOptional(), optional-purpose updates
  • Project webhook: consent.updated with X-Accord-Signature (Webhooks)

Verify: banner on first visit → accept → reload with no banner if stored consent valid → Receipts / Develop shows live traffic.

Verify

CheckExpected
VersionsAt least one published version
OriginsProduction host listed if allowlist on
KeyKey exists (raw secret only at create time)
Receipts≥1 receipt after accept

Common failures

SymptomCheck
no_published_versionPublish consent
origin_not_allowedAllowed origins
invalid_key / revoked_keyKey create/revoke
No receiptsNetwork tab POST consent; versionId/hash match

Next