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.
Registry reference
Every field of privacy.registry.yaml: its type, whether it is required, its default, and what it changes in the generated files. The contract is packages/schema/src/types.ts; the JSON Schema is packages/schema/registry.schema.json.
Unknown fields are rejected everywhere (schema/unknown-property). A complete, valid example is packages/schema/fixtures/vacation-planner.registry.yaml; the snippets on this page are taken from it.
Conventions
Section titled “Conventions”| Term | Meaning |
|---|---|
| id | Lowercase, starts with a letter, then letters, digits, _ or - (^[a-z][a-z0-9_-]*$). Ids must be unique within their section. Identity is by id: renaming one is a removal plus an addition. |
| locale | A language tag such as en, de or pt-BR. |
| localized text | A map of locale to a non-empty string. It must have exactly the locales in locales: a missing one is locale/missing-text, an extra one is locale/undeclared-text. |
| required | “Yes” means the registry does not validate without the field. Some fields are optional in the TypeScript type but required by the validator; this page lists what the validator requires. |
| declared URL | An http(s) URL, or a site-relative path that starts with one /. It is located by parsing, not by its first characters: //host/x is third-party. A value with a backslash, whitespace or a control character is refused. A declared path covers whole path segments: /collect covers /collect and /collect/x, not /collector. A bare origin covers every path on it. |
Top level
Section titled “Top level”| Field | Type | Required | What it is for |
|---|---|---|---|
version |
1 |
Yes | The registry file format version. Only 1 exists. |
controller |
object | Yes | Who is responsible for the processing. Printed in the privacy policy. See Controller. |
locales |
locale[], at least one, unique | Yes | Every language the site speaks. Each one gets a banner translation and, where the phrase library has the language (English, German), a set of documents. The banner’s own button labels and headings exist in English and German; any other locale gets the English ones around your texts. |
defaultLocale |
locale | Yes | Must be in locales (locale/default-not-declared). Becomes CookieConsent’s language.default. |
purposes |
Purpose[] | Yes | Why data is processed, and on which lawful basis. |
processors |
Processor[] | Yes, may be [] |
The recipients of data. |
artefacts |
Artefact[] | Yes, may be [] |
Every cookie, storage key and network resource. |
collectionPoints |
Collection point[] | Yes, may be [] |
Forms that collect personal data. |
dataCategories |
map of id to { title, special? } |
No | Names for the ids in purposes[].dataCategories. See Glossaries. |
dataSubjectCategories |
map of id to { title } |
No | Names for the ids in purposes[].dataSubjects. |
retentionEvents |
map of id to localized text | No | What the <event> in a retention such as 30d-after-closed means. |
securityMeasures |
localized text | No | General description of the technical and organisational security measures (Art. 30(1)(g) GDPR). Printed in the record of processing. Absent: an advisory gap in the documents report. |
csp |
object | No | Deviations from the strict Content-Security-Policy. Absent: the strict policy, enforced. See csp. |
receipts |
object | Yes, once any purpose has basis: consent |
Where the proof of each consent decision goes. See receipts. |
subjectRequests |
object | No | Receiving access and erasure requests through a form on the site. Adds the built-in purpose subject-requests. See subjectRequests. |
imprint |
object | No | The provider identification (German “Impressum”, § 5 DDG, § 18 (2) MStV). Its presence makes docs write imprint.<locale>.md. See imprint. |
presets |
Preset use[] | No | Adopted provider presets. Expanded into processors and artefacts when the file is loaded. |
Controller
Section titled “Controller”controller: name: Vacation Planner contact: privacy@vacation-planner.example address: Beispielweg 12, 10115 Berlin, Germany dpo: false supervisoryAuthority: name: Example Data Protection Authority url: https://dpa.example/complaints| Field | Type | Required | What it is for |
|---|---|---|---|
controller.name |
string | Yes | Printed as the controller in the privacy policy, and as the provider of first-party cookies in the banner’s cookie table. |
controller.contact |
string | Yes | Printed with the name. With imprint it must be an email address (imprint/contact-not-email). |
controller.address |
string | No; yes with imprint |
Printed with the name and contact. Absent: an advisory gap. With imprint it is required (imprint/missing-controller-address). |
controller.dpo |
false, or { name?, contact } |
Yes | The data protection officer (Art. 13(1)(b) GDPR). false states that none is designated. Leaving the field out is an error (controller/dpo-not-stated), because silence cannot be told from an oversight. contact is an email address, URL or postal address. |
controller.supervisoryAuthority |
{ name, url?, address? } |
Yes | Where complaints go (Art. 13(2)(d), Art. 77 GDPR). Missing: controller/missing-supervisory-authority. |
controller.euRepresentative |
{ name, contact, address? } |
No | The Art. 27 representative of a controller not established in the Union. Absent means not needed; the registry does not record where the controller is established, so the validator cannot demand it. |
Changes to name, contact or address are material. Changes to the officer, the authority or the representative update the notice of every purpose and need a confirmation, but do not ask visitors again. See change classifications.
Purposes
Section titled “Purposes”purposes: - id: analytics version: 1 basis: consent default: denied title: en: Visitor statistics de: Besucherstatistik description: en: Counts page views and referring sites, without cookies, to see which trip guides are read. de: Zählt Seitenaufrufe und verweisende Websites, ohne Cookies, um zu sehen, welche Reiseführer gelesen werden. dataCategories: [usage_events, ip_address] retention: 365d automatedDecisionMaking: false dataSubjects: [visitors]| Field | Type | Required | Default | What it is for |
|---|---|---|---|---|
id |
id | Yes | For a consent purpose this is also the CookieConsent category id, the data-category of gated script tags and the category the guard checks. necessary is reserved (purpose/reserved-id). |
|
version |
integer, 1 or more | Yes | Starts at 1. Raise it by exactly 1 in the same change as any material change to the purpose. check fails when a bump is missing, skipped or goes down. Sent in every consent receipt. |
|
basis |
consent, contract, legal_obligation, legitimate_interest, vital_interests, public_task |
Yes | The lawful basis. Only consent purposes get a toggle in the banner; artefacts bound to them are held back until the visitor agrees. A purpose on any other basis never gets a toggle; the cookies and storage keys of its artefacts are listed in the banner’s read-only “Strictly necessary” group. Changing it is needs_review. |
|
title |
localized text | Yes | The category name in the banner and the heading in the documents. | |
description |
localized text | Yes | What is done, with which data, and why. Shown in the banner and the documents. For a consent purpose a description that is nothing more than a stock phrase such as “marketing purposes” or “analytics” is rejected (purpose/vague-text). |
|
dataCategories |
string[], unique | Yes, may be [] |
Kinds of personal data processed, as ids. Printed in the documents under their dataCategories names. |
|
retention |
string | Yes | session, until-withdrawn, <n>d or <n>y (calendar years), or either followed by -after-<event>. Printed as the storage period. Anything else: purpose/invalid-retention. Years compare with days only where every calendar year settles it: 1y is longer than 364d, shorter than 367d, and neither longer nor shorter than 365d. |
|
default |
denied or granted |
No | denied |
Only allowed on a consent purpose, where it must be denied or absent (purpose/consent-default-not-denied). On any other basis it is an error (purpose/default-on-non-consent). |
legitimateInterest |
localized text | Yes when basis: legitimate_interest; an error on any other basis |
The interest pursued (Art. 13(1)(d) GDPR). Printed with the purpose in the privacy policy. | |
automatedDecisionMaking |
false, or { logic, consequences } (both localized text) |
Yes | Art. 13(2)(f) GDPR. false states that none takes place. true alone is not accepted: the article asks for the logic and the consequences. Introducing it is needs_review. |
|
dataSubjects |
id[], at least one, unique | Yes | Categories of data subjects (Art. 30(1)(c) GDPR). Printed in the record of processing. | |
processors |
id[], unique | No | not stated | Recipients of this purpose’s data that no artefact shows, such as the email provider behind a form. [] states that there are none besides the processors of the purpose’s artefacts. Absent, with no artefact naming a processor either: the documents report an advisory gap. |
Processors
Section titled “Processors”processors: - 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/| Field | Type | Required | Default | What it is for |
|---|---|---|---|---|
id |
id | Yes | For an artefact bound to a consent purpose, the processor id is the CookieConsent service key inside the category, the data-service of the script tag, and the service the guard checks. |
|
name |
string | Yes | The service label in the banner and the name in the documents. | |
role |
processor, independent_controller, joint_controller |
No | processor |
How the recipient relates to the controller. Printed in the processor list. A change is material. |
legalEntity |
string | No | Printed after the name when it differs from it. | |
country |
ISO 3166-1 alpha-2, upper case | Yes | Decides whether the documents report a third-country transfer. | |
firstParty |
boolean | No | false |
true when the controller itself runs this. Such a processor is not listed as a recipient. |
transferMechanism |
adequacy, scc, dpf, bcr |
Yes when country is outside the EU/EEA |
The safeguard printed for the transfer. Missing: processor/missing-transfer-mechanism. The EU/EEA list is the EU-27 plus Iceland, Liechtenstein and Norway. |
|
dpaUrl |
string | No | Link to the data processing agreement. Absent: an advisory gap in the processor list. | |
privacyUrl |
string | No | Link to the processor’s privacy policy. | |
subjectRequestProcess |
string | No | Where to send a data-subject request for data this processor holds. Printed in the processor list. |
A processor that no artefact uses and no purpose lists is an error (processor/unreferenced): no document could say what it receives data for.
Artefacts
Section titled “Artefacts”An artefact is one thing the site sets, reads, loads or sends to. All kinds share these fields:
| Field | Type | Required | What it is for |
|---|---|---|---|
id |
id | Yes | Used in error messages, reports, the generated registry.gen.ts and consent-kit script-tag. |
kind |
script, cookie, storage, iframe, pixel, endpoint, stylesheet, font, media |
Yes | Decides the other fields, the CSP directive and how the artefact is gated. |
purposes |
id[], at least one, unique | Yes | The purposes the artefact serves. If any of them is a consent purpose, the artefact needs consent for all of its consent purposes. With none, it is always allowed. |
processor |
id | Yes for anything that loads from or sends to a third-party URL (artefact/third-party-without-processor) |
The vendor. Named as a recipient in the documents. |
description |
localized text | No | Shown in the cookie tables. |
Fields per kind:
| Kind | Fields | Notes |
|---|---|---|
script |
src (declared URL, required) |
A script can be bound to at most one consent purpose (script/multiple-consent-purposes), because the banner gates a script tag on one category. Feeds script-src. First-party scripts need no declaration. |
cookie |
exactly one of name or pattern (a RegExp source such as ^_ga_); duration (required: session or <n>d); domain, sameSite (Strict, Lax, None), secure, httpOnly (all optional) |
The guard and the storage facade match on the name or pattern. The facade writes the cookie with the declared attributes. Cookies of a consent purpose are in the category’s autoClear list, so CookieConsent erases them on withdrawal. |
storage |
area (required: local, session, indexeddb); exactly one of key or pattern; duration (optional: persistent or <n>d) |
For indexeddb, key is the database name. duration is a declaration for the cookie tables; your own code has to honour it. Absent: the browser’s default for the area. |
iframe |
src (an origin or URL prefix, required) |
Feeds frame-src. Render it with consentEmbed. |
pixel |
url (declared URL, required) |
Feeds img-src. |
endpoint |
url (an origin or URL prefix, required) |
Where first-party code sends data with fetch, XMLHttpRequest or sendBeacon. Feeds connect-src. |
stylesheet, font, media |
src (a file URL, an origin or a URL prefix, required) |
Feed style-src, font-src, media-src. They cannot be bound to a consent purpose (artefact/consent-not-enforceable): nothing consent-kit generates can hold a <link>, a CSS url() or a <video> back until consent. Files the site serves itself need no declaration. |
artefacts: - id: cc_cookie kind: cookie name: cc_cookie duration: 182d sameSite: Lax purposes: [essential] description: en: Stores your cookie choices. de: Speichert Ihre Cookie-Auswahl.
- id: plausible_script kind: script src: https://plausible.io/js/script.js processor: plausible purposes: [analytics]The Content-Security-Policy uses only the origin of a declared URL. The guard manifest and the audit keep the declared path. See Content-Security-Policy reference.
Collection points
Section titled “Collection points”A collection point is a form. Its fields say which purpose each piece of data is collected for.
collectionPoints: - id: correction_form title: en: Report a mistake de: Fehler melden description: Report a mistake in a trip guide. fields: - name: email purpose: correction_reply required: true provision: contractual consequence: en: Without an email address we cannot reply to your report. de: Ohne E-Mail-Adresse können wir auf Ihre Meldung nicht antworten. - name: display_name purpose: contributor_credit provision: voluntary| Field | Type | Required | What it is for |
|---|---|---|---|
id |
id | Yes | The key of the form in field-notices.<locale>.json. |
title |
localized text | No | The form’s name in the documents. |
description |
string | No | An internal note. Never printed in a document. |
fields |
field[] | Yes | Field names must be unique within the point (collection-point/duplicate-field). |
fields[].name |
string | Yes | Identity of the field within its point. |
fields[].purpose |
id | Yes | The purpose the field is collected for. |
fields[].required |
boolean | No | Whether the form requires the field. Making a field required is a material change. |
fields[].notice |
localized text | No | The text shown at the field. Generated from the purpose when omitted. |
fields[].provision |
statutory, contractual, voluntary |
Yes | Whether the data has to be provided (Art. 13(2)(e) GDPR). Missing: collection-field/missing-provision. |
fields[].consequence |
localized text | Yes unless provision: voluntary |
What happens when the data is not provided. Missing: collection-field/missing-consequence. |
Glossaries
Section titled “Glossaries”The three maps give names to ids that purposes use. Each is optional, but once a map exists every id used must be declared in it (purpose/unknown-data-category, purpose/unknown-data-subject, purpose/unknown-retention-event). Without a name, the documents print the id and report an advisory gap.
dataCategories: email: title: { en: Email address, de: E-Mail-Adresse }
dataSubjectCategories: visitors: title: { en: Visitors of the website, de: Besucherinnen und Besucher der Website }
retentionEvents: closed: en: the report is closed de: Abschluss der Meldung| Field | Type | What it is for |
|---|---|---|
dataCategories.<id>.title |
localized text | The name of the data category in the documents. |
dataCategories.<id>.special |
boolean | true marks a special category of personal data (Art. 9 GDPR). Setting or clearing it is needs_review. |
dataSubjectCategories.<id>.title |
localized text | The name of the category of data subjects. |
retentionEvents.<id> |
localized text | What happens, worded to follow “after”: 30d-after-closed prints as “30 days after the report is closed”. |
Every way in which the generated Content-Security-Policy is weaker than, or different from, the strict default. See loosen the CSP.
csp: allow: - directive: style-src sources: ["'unsafe-inline'"] reason: The legacy chat widget sets style attributes (WEB-123). reportOnly: true reportUri: /csp-reports reportTo: csp upgradeInsecureRequests: false| Field | Type | Required | Default | What it changes |
|---|---|---|---|---|
csp.allow |
entry[] | No | none | Adds sources to directives. |
csp.allow[].directive |
string | Yes | One of default-src, script-src, style-src, font-src, img-src, connect-src, frame-src, media-src, worker-src, manifest-src, object-src, base-uri, form-action, frame-ancestors. Anything else: csp/unknown-directive. |
|
csp.allow[].sources |
string[], at least one, unique | Yes | Source expressions exactly as they appear in the header: a quoted keyword ('unsafe-inline'), a scheme (data:), a host (https://cdn.example, *.example.org), a hash or a nonce. A source added to a directive whose only value is 'none' replaces the 'none'. |
|
csp.allow[].reason |
string | Yes | Why the site needs it. Printed wherever the deviation is listed. | |
csp.reportOnly |
boolean | No | false |
true emits Content-Security-Policy-Report-Only: violations are reported, nothing is blocked. |
csp.reportUri |
declared URL | No | Adds report-uri. A third-party URL must be covered by a declared endpoint artefact (csp/undeclared-report-endpoint). |
|
csp.reportTo |
string of letters, digits, -, _ |
No | Adds report-to. With reportUri, a Reporting-Endpoints header for the group is generated too. |
|
csp.upgradeInsecureRequests |
boolean | No | true |
false leaves out upgrade-insecure-requests. The directive is also left out automatically, and reported, when the registry declares an http: URL. |
receipts
Section titled “receipts”Required as soon as one purpose has basis: consent (receipts/not-stated). Exactly one of the two forms.
receipts: endpoint: /api/consent-receiptsreceipts: optOut: reason: Decisions are recorded by the parent site's consent service (PRIV-12).| Field | Type | What it changes |
|---|---|---|
receipts.endpoint |
a site-relative path, or an https: URL |
The generated CookieConsent module POSTs one JSON receipt per decision here. Its origin is added to connect-src. build also writes receipts.manifest.gen.json. A third-party URL must be covered by a declared endpoint artefact (receipts/undeclared-endpoint) whose purposes are not based on consent (receipts/endpoint-needs-consent), because a rejection is recorded too. |
receipts.optOut.reason |
string | No receipts are sent. check and build print the warning receipts/opted-out with the reason; the audit report states it. A stock non-reason such as “n/a”, “not needed” or “TODO” is rejected (receipts/vague-reason). |
See consent receipts and opt out of receipts.
subjectRequests
Section titled “subjectRequests”Optional. Receiving data subject requests (access, Art. 15, and erasure, Art. 17 GDPR) through a form on the site’s own domain. See data subject requests.
subjectRequests: endpoint: /privacy/requests notify: privacy@example.com types: [access, erasure] retention: 3y requesterEmail: processor: resend| Field | Type | Required | What it changes |
|---|---|---|---|
endpoint |
a site-relative path, no query or fragment | Yes | Where the generated form posts and the handler answers. Never another origin, so that the browser sends its consent cookie (subject-requests/endpoint-not-same-origin). |
notify |
email address | Yes | Every request is emailed here (subject-requests/invalid-notify). |
types |
access, erasure; at least one, unique |
Yes | The choices of the form, and what the handler accepts (subject-requests/unknown-type). |
retention |
<n>d or <n>y |
Yes, no default | How long a request record is kept after the request is closed (subject-requests/retention-format). Printed in the privacy policy and the form’s notice. |
requesterEmail.processor |
processor id | No | Also email the requester a confirmation link, through this declared processor (subject-requests/unknown-processor). The processor becomes the recipient of the built-in purpose and counts as referenced. |
With the section, build writes the request form, its page and subject-requests.manifest.gen.json (see generated files). The documents list the built-in purpose subject-requests (“Handling your data protection requests”). Its basis is legal_obligation, its data categories are requester_email and request_details, its data subjects are requesters, and its retention is <retention>-after-subject-request-closed. Its recipients are the requesterEmail processor or none. It is derived, not written into purposes, and no purpose may use its id while the section exists (subject-requests/purpose-id-taken). The registry has no site origin, so the validator cannot check that notify is on the site’s domain.
imprint
Section titled “imprint”Optional. The provider identification a German website owes its visitors: § 5 DDG (the Digitale-Dienste-Gesetz, which replaced § 5 TMG in May 2024) and, for journalistic-editorial content, § 18 (2) MStV. With the section, docs writes imprint.<locale>.md; see the documents reference.
The name, the postal address and the email address are not repeated here: they come from controller.name, controller.address and controller.contact. With the section, controller.address is required and controller.contact must be an email address. The address must be one where the provider can be served documents; a P.O. box is not enough, which the validator cannot check. For a sole trader, controller.name should be the owner’s first and last name (a business name may follow it, as in “Jane Doe – Doe Design”).
imprint: phone: "+49 30 1234567" vatId: DE123456789A company:
imprint: legalForm: GmbH representedBy: [Erika Mustermann] phone: "+49 30 1234567" register: type: commercial court: Amtsgericht Charlottenburg number: HRB 123456 B vatId: DE123456789 editorialResponsible: name: Erika Mustermann address: Hauptstr. 1, 10115 Berlin| Field | Type | Required | What it changes |
|---|---|---|---|
legalForm |
string | No | Printed under the name (“Rechtsform: GmbH”). Leave it out for a sole trader. |
representedBy |
string[], at least one, unique | No | The persons authorised to represent a legal entity, such as its managing directors (“Vertreten durch”). Needed for a company; the validator cannot tell a company from a sole trader, so it does not demand it. |
phone |
string | No | A telephone number, printed under the email address. Digits, spaces, +, -, /, . and parentheses, with at least 6 digits (imprint/invalid-phone). |
contactForm |
an http(s) URL or a site-relative path |
No | A contact form, printed under the email address (imprint/invalid-contact-form). |
register |
{ type, court, number } |
No | The register entry (§ 5 (1) no. 4 DDG). type is commercial (Handelsregister), association (Vereinsregister), partnership (Partnerschaftsregister) or cooperative (Genossenschaftsregister); court the register court; number the registration number. All three are required. |
vatId |
string | No | The VAT identification number under § 27a UStG: a country prefix and 2 to 13 letters or digits, without spaces (imprint/invalid-vat-id). |
businessId |
string | No | The business identification number (Wirtschafts-Identifikationsnummer) under § 139c AO. |
editorialResponsible |
{ name, address } |
No | The person responsible for journalistic-editorial content under § 18 (2) MStV, with their postal address. Only for a site with such content, such as a blog or a magazine. |
§ 5 (1) no. 2 DDG asks for a fast, direct way of getting in touch besides the email address; the common reading is a second channel. Without phone or contactForm the documents report an advisory gap. A change anywhere in the section is not_material and affects no purpose: the imprint describes no processing (see change classifications).
Not covered: the details of regulated professions (chamber, professional title, professional rules), the supervisory authority of an activity that needs an official licence, share capital, companies in liquidation, and the consumer dispute resolution statement (§ 36 VSBG). A provider to whom one of those applies adds it by hand, or waits for a later version.
presets
Section titled “presets”Each entry adopts one provider preset. See presets reference for the catalogue and the rules.
presets: - use: acme-analytics version: 1 purpose: analytics with: origin: http://127.0.0.1:4174| Field | Type | Required | Meaning |
|---|---|---|---|
use |
string | Yes | The preset id in the catalogue. |
version |
integer or string | Yes | An integer selects the newest version of that major. A string selects one exact version, such as "1.0.0". |
purpose |
id | One of purpose or purposes |
Your purpose id, for a preset with one purpose slot. |
purposes |
map of slot to id | For a preset with several slots. Every slot must be mapped. | |
with |
map of parameter to string, number or boolean | When the preset has a parameter without a default | Parameter values. |
ids |
map of default id to your id | No | Renames the processor or artefacts. A rename is not an override. |
exclude |
string[] | No | Default ids of artefacts you do not use. Recorded as an override. |
overrides |
{ processor?: {…}, artefacts?: { <default id>: {…} } } |
No | Local deviations from the documented defaults. Any field except id and kind; null removes an optional field. Always recorded and shown. |
What is not in the registry
Section titled “What is not in the registry”- First-party scripts, stylesheets, fonts and media files. They are allowed by
'self'in the policy and need no declaration. - Where a form posts to.
form-actionis'self'; a third-party form target is acsp.allowentry. - The value stored under a key. The registry says what a key is for, not what is in it.
- The free-form introduction and closing of the privacy policy, phrase overrides and cookie-table links. Those live in
privacy.documents.json; see project files.