PrivacyKit enables consent banners, blocks tracking until users give consent, and keeps performance fast — with minimal setup and no account required. Works across subdomains. Works with any stack.
Production-ready dialog layouts that stay up to date and require no maintenance.
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>
<!-- Add consent-guard(s) to block/load 3rd party scripts -->
<consent-guard consent="marketing">
<script type="text/plain" data-src="https://example.com/marketing-script.js"></script>
</consent-guard>
</head>
<body>
<!-- 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-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);
">
<div slot="dialog-title">
<h2 class="your-class">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 3rd party scripts as well as local JavaScript and HTML-snippets. 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.getSubscriptionStatus(): {
status: string | null;
billingInterval: string | null;
subscriptionEnd: string | null;
trailingEnd: string | null;
} | null
PrivacyKit works out of the box with no setup or 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.