PrivacyKit enables consent banners, blocks tracking until users give consent, and keeps performance fast — with minimal setup and no account required. Consent is shared across subdomains.
Production-ready dialog layouts that stay up to date and require no maintenance — use them as-is or customize styling and content to match your site.
Add the script to your <head> and the consent dialog to your page to get started. No npm install. No dependency conflicts.
<html>
<head>
<!-- Add PrivacyKit web components: consent-dialog, consent-guard, consent-missing -->
<script type="module" src="https://cdn.privacykit.eu/privacykit/privacykit.esm.js"></script>
<script nomodule src="https://cdn.privacykit.eu/privacykit/privacykit.js"></script>
<!-- Add PrivacyKit JavaScript API for frameworks like React and Vue (optional) -->
<script type="module" src="https://cdn.privacykit.eu/privacykit/index.esm.js"></script>
</head>
<body>
<!-- Add consent-guard(s) to block/load 3rd party scripts -->
<consent-guard consent="analytics+marketing">
<script type="text/plain" data-src="https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXXX"></script>
</consent-guard>
<!-- Add consent-dialog -->
<consent-dialog variant="standard"></consent-dialog>
</body>
<html>Style your consent dialog using design tokens and tailor content with flexible HTML slots using styles from your own light DOM.
<consent-dialog variant="standard" style="
--pk-bg-color: #faf7f2;
--pk-paper-color: #f7eede;
--pk-text-color: #3a3530;
--pk-primary-color: #b08968;
--pk-secondary-color: #d6c2b2;
--pk-border-color: #d6dbe4;
--pk-border-width: 3px;
--pk-font-family: 'Segoe UI', Tahoma, sans-serif;
--pk-spacing-unit: 0.6rem;
--pk-control-radius: 10px;
--pk-dialog-radius: 20px;
--pk-dialog-shadow: 10px 20px rgba(0, 0, 0, 0.5);
">
<img slot="dialog-logo" width="100px" src="/logo.png" alt="Company logo" />
<div slot="dialog-title" class="your-class">
<h2>We use cookies</h2>
</div>
<span slot="marketing-content">
<b>We currently do not collect cookies for marketing purposes.</b>
</span>
</consent-dialog>Guards protect exectution of local JavaScript and HTML-snippets as well as 3rd party scripts. Use <consent-missing> to inform users of missing content as needed.
<body>
<consent-guard id="123" consent="analytics+marketing">
<iframe data-src="https://www.youtube.com/embed/abc123"></iframe>
<consent-guard>
<consent-missing for="123">
<p>Please accept analytics cookies and marketing cookies to view this content.</p>
</consent-missing>
</body>
JavaScript API for frameworks like React and Vue, where rendering is handled outside the DOM. TypeScript support included — add privacykit.d.ts to your project for autocomplete and type safety.
const api = window.PrivacyKit;
api.onReady(callback: () => void): () => void
api.readConsent(): {
analytics: boolean;
marketing: boolean;
preferences: boolean;
} | null
api.hasConsent(expression?: string): boolean
api.openConsentDialog(): void
api.onConsentDialogClosed(callback: () => void): () => void
api.onConsentChanged(callback: (consent: {
analytics: boolean;
marketing: boolean;
preferences: boolean;
} | null) => void): () => void
api.openPrivacyPolicyDialog(): void
See PrivacyKit in action with both a framework-agnostic HTML demo and a React integration.
PrivacyKit works out of the box with minimal setup and no account required. A trial is included — activate your subscription to keep everything running without limitations.
Partner with PrivacyKit. Mid-size to large companies can apply to become a PrivacyKit partner. Approved partners will have their brand logo featured and receive a free subscription for the first year. This is a limited offer. Contact support@privacykit.eu to apply.