Beta. consent-kit is at 0.x: expect breaking changes between releases, and treat everything it generates as a draft. Report a problem or share feedback.
consent-kit keeps a website’s cookie banner, its privacy documents and what the site really does in the browser in agreement, by generating all three from one file, privacy.registry.yaml.
You describe every cookie, storage key, third-party script, iframe, pixel, endpoint, stylesheet, font and media file the site uses, each with its purpose and lawful basis. consent-kit validates that file, compares it with the last released version, and compiles it into the files the site needs. A browser audit then checks a running site against the same file.
The pipeline
Section titled “The pipeline”flowchart LR
R[privacy.registry.yaml] --> C{consent-kit check}
L[privacy.lock.json<br/>last release] --> C
V[privacy.review.json<br/>human sign-off] --> C
C --> B[consent-kit build]
C --> D[consent-kit docs]
C --> REL[consent-kit release]
REL --> L
B --> G1[CookieConsent config]
B --> G2[Content-Security-Policy]
B --> G3[inline guard]
B --> G4[storage facade]
B --> G5[receipt manifest]
D --> P[privacy policy, cookie table,<br/>record of processing, ...]
R --> A[consent-kit audit]
S[running site] --> A| Step | Command | What happens |
|---|---|---|
| Validate and classify | consent-kit check |
The registry is validated. Every change since the last release is classified as material or not. Material changes need a purpose version bump; some changes need a person’s sign-off. |
| Generate | consent-kit build |
Writes the CookieConsent v3 configuration, a strict Content-Security-Policy, the inline runtime guard, a typed storage module and, when receipts are kept, the receipt manifest. |
| Write documents | consent-kit docs |
Writes the privacy policy, cookie table, record of processing activities, processor list, field notices and changelog entry, in English and German, as drafts. |
| Release | consent-kit release |
Records the registry as released in privacy.lock.json and raises the consent revision when visitors have to be asked again. |
| Audit | consent-kit audit <url> |
Drives the running site in Chromium and reports anything it does that the registry does not declare, or does before consent. |
Sections
Section titled “Sections”- Getting started: a tutorial that takes a static site from an empty folder to a passing audit.
- Concepts explain how the parts fit and why they are built the way they are: the registry model, how consent flows at runtime, material changes and re-consent, consent receipts, Global Privacy Control, documents and phrase review, the threat model and known limits, and data subject requests.
- Guides are task instructions. Each assumes you have a project that builds. To bring consent-kit into an app you already run, start with add consent-kit to an existing app.
- Reference pages are complete and dry: registry fields, validation rules, change classifications, the CLI, generated files and the rest.
- FAQ and compliance notes: what consent-kit establishes and what it does not.
Where to start
Section titled “Where to start”Packages
Section titled “Packages”| Package | What it provides |
|---|---|
@consent-kit/cli |
The command line tool (the consent-kit command). Also re-exports the helpers a site’s build script needs. |
@consent-kit/schema |
Registry types, JSON Schema, validation, and the diff between two registry versions. |
@consent-kit/compiler |
Policy snapshot, CookieConsent config, guard manifest, Content-Security-Policy, consent-gated script tags and iframe placeholders. |
@consent-kit/guard |
The browser runtime guard, as an inline script or an installable function. |
@consent-kit/storage |
The typed, consent-aware storage facade, embed activation and the receipt sender. |
@consent-kit/eslint-plugin |
The @consent-kit/no-raw-storage rule. |
@consent-kit/documents |
The document generator and its English and German phrase library. |
@consent-kit/presets |
Versioned, sourced declarations of third-party tools. |
@consent-kit/audit |
The Playwright audit. An optional peer of consent-kit. |
@consent-kit/server |
The receiving end of consent receipts: a Fetch API handler and a Cloudflare D1 adapter. |
The published packages run on Node.js 22 or newer. Working on the repository itself needs Node.js 22.6 or newer and pnpm 10.