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.
The registry model
privacy.registry.yaml is one statement of what a site does with personal data: why (purposes), with whose help (processors), by which technical means (artefacts) and through which forms (collection points). This page explains each part and how they connect.
Field-by-field detail is in the registry reference. The examples here come from packages/schema/fixtures/vacation-planner.registry.yaml.
One file, many readers
Section titled “One file, many readers”The banner, the privacy policy and the site’s actual behaviour drift apart when each is maintained by hand. The registry removes the copies. Everything else is derived from it:
flowchart TD P[purposes] --> B[banner categories] P --> D[privacy policy, record of processing] PR[processors] --> S[banner services] PR --> D A[artefacts] --> G[guard manifest] A --> CSP[Content-Security-Policy] A --> F[storage facade] A --> T[cookie tables] CP[collection points] --> N[field notices] CP --> D
The registry is a declaration, and consent-kit takes it at its word. It can check that the declaration is internally consistent, that the site does nothing the declaration omits (the audit), and that a change is not slipped past visitors (the diff). It cannot check that the declaration is true, complete or lawful.
Purposes and lawful bases
Section titled “Purposes and lawful bases”A purpose is one reason for processing personal data, stated the way a visitor would read it.
- id: analytics version: 1 basis: consent default: denied title: en: Visitor statistics description: en: Counts page views and referring sites, without cookies, to see which trip guides are read. dataCategories: [usage_events, ip_address] retention: 365d automatedDecisionMaking: false dataSubjects: [visitors]Every purpose names its lawful basis: consent, contract, legal_obligation, legitimate_interest, vital_interests or public_task. The basis decides almost everything downstream:
basis: consent |
Any other basis | |
|---|---|---|
| Banner | One category with a toggle, off by default | No toggle. Its cookies and storage keys are listed in the read-only “Strictly necessary” group. |
| Artefacts bound to it | Held back until the visitor agrees | Always allowed |
| A material change | Visitors are asked again | The notice is updated; nobody is asked |
| Receipts | Every decision about it is sent as proof | Never part of a receipt |
Choosing the basis is a legal decision that consent-kit does not make for you. It only enforces the consequences. A consent purpose must default to denied. A purpose based on legitimate interests must state the interest. Changing a basis later is always held for human review.
Some statements are required even when the answer is “no”, because silence cannot be told from an oversight:
automatedDecisionMaking: falseon every purpose;dpo: falseon a controller without a data protection officer;processors: []on a purpose whose data no one else receives (optional, but its absence is reported).
A purpose also has a version, which starts at 1 and goes up by one whenever what the visitor was told about it changes. See material changes and re-consent.
Describing a purpose
Section titled “Describing a purpose”The description is what a visitor consents to, so for a consent purpose it has to say something. A description that is nothing more than a stock phrase (“marketing purposes”, “analytics”, “improving user experience”) is rejected. The check is deliberately narrow: a sentence that says what is done, with which data and why passes, even if it contains the word “analytics”.
This catches the lazy case only. Whether a description is specific enough is still yours and your counsel’s to judge.
Processors
Section titled “Processors”A processor is anyone who receives data: a vendor, a hosting provider, an email service.
- id: cloudflare name: Cloudflare legalEntity: Cloudflare, Inc. country: US transferMechanism: dpf dpaUrl: https://www.cloudflare.com/cloudflare-customer-dpa/ privacyUrl: https://www.cloudflare.com/privacypolicy/The entry is named “processor” for the common case, but role can also say independent_controller or joint_controller. A processor outside the EU/EEA must name the mechanism the transfer relies on.
A processor is connected to purposes in two ways: through the artefacts that load from or send to it, and through a purpose’s own processors list, for recipients that no artefact shows (the email provider behind a form). A processor connected to nothing is an error, because no document could say what it receives data for.
In the banner, each processor with an artefact in a consent category becomes a service inside that category, with a toggle of its own. A visitor can accept “Visitor statistics” but switch off one vendor in it.
Artefacts
Section titled “Artefacts”An artefact is one concrete thing the site sets, reads, loads or sends to. There are nine kinds.
| Kind | What it declares | Held back until consent by |
|---|---|---|
cookie |
A cookie, by name or pattern | The storage facade and the guard |
storage |
A localStorage, sessionStorage or IndexedDB entry | The storage facade and the guard |
script |
A script loaded from a URL | A blocked <script type="text/plain"> tag that CookieConsent activates; the guard |
iframe |
An embedded frame | A placeholder that syncEmbeds replaces; the guard |
pixel |
An image request that carries data | Your code. The guard does not block requests. |
endpoint |
Where first-party code sends data | Your code. The guard does not block requests. |
stylesheet, font, media |
A third-party file the page loads without running it | Nothing. These cannot be bound to a consent purpose at all. |
Each artefact lists the purposes it serves. That one list is what ties the technical world to the legal one:
- If any of an artefact’s purposes is a consent purpose, the artefact needs consent for all of its consent purposes.
- If it also has a processor, that processor’s service must be accepted too.
- If none of its purposes is a consent purpose, it is always allowed.
Anything third-party needs a processor. First-party files (your own scripts, stylesheets, fonts, images) are not declared at all: the Content-Security-Policy admits them through 'self', and the guard treats same-origin scripts and iframes as first-party code.
Why three kinds cannot wait for consent
Section titled “Why three kinds cannot wait for consent”Nothing consent-kit generates can hold back a <link rel="stylesheet">, a CSS url() or a <video> until consent. CookieConsent only manages <script> tags, the guard has no hook for these loads, and the Content-Security-Policy is the same before and after a decision. Rather than generate a gate that would not hold, the validator refuses the combination. You host the file yourself, bind it to a purpose with another lawful basis that you can defend, or load it from a consent-gated script.
Collection points
Section titled “Collection points”A collection point is a form. Each field says which purpose it is collected for, whether the visitor has to provide it (statutory, contractual, voluntary), and what happens if they do not.
- id: correction_form fields: - name: email purpose: correction_reply required: true provision: contractual consequence: en: Without an email address we cannot reply to your report. - name: display_name purpose: contributor_credit provision: voluntaryHere one form serves two purposes on two bases. The email address is needed to reply (contract). The display name is shown publicly only if the contributor agrees (consent), so the generated field notice for it is the label of an unticked consent checkbox. consent-kit writes the notices; rendering them in the form is your code’s job.
Glossaries
Section titled “Glossaries”Purposes refer to data categories, data subject categories and retention events by id. Three optional maps give those ids the names the documents print, and dataCategories.<id>.special: true marks an Art. 9 special category. Once a map exists, every id used must be in it.
What identity means
Section titled “What identity means”Everything in the registry is identified by its id. There is no rename detection: renaming an id is a removal plus an addition, and an addition is material. Choose ids you can live with.
Order carries no meaning. Reordering purposes or artefacts changes nothing, not even the policy hash.
Presets
Section titled “Presets”A preset writes a processor and its artefacts for you, from a versioned, sourced declaration of one third-party tool. By the time anything else reads the registry, the preset has been expanded into ordinary entries. See add a vendor with a preset.
Statements about the site itself
Section titled “Statements about the site itself”Two sections describe the deployment rather than the processing, and live in the registry so that they are validated, hashed, diffed and signed off like everything else:
csplists every deviation from the strict Content-Security-Policy, each with a reason.receiptssays where the proof of each consent decision goes, or that the site keeps none and why. It is required as soon as one purpose is based on consent.
- How consent flows at runtime: what the generated files do with these declarations.
- Write a registry entry: the steps.