RGPD-compliant cookie consent manager with CDN WebComponent and NPM API
npm install @n-ramos/cookie-consent



Gestionnaire de consentement cookies RGPD / CNIL compliant, moderne, léger et totalement configurable.
Alternative open-source à Axeptio / Didomi, sans SaaS ni dépendance externe.
---
- RGPD / CNIL compliant
- Google Consent Mode v2
- Activation différée des scripts (type="text/plain")
- Nettoyage automatique des cookies
- UI entièrement personnalisable (textes + classes)
- Compatible Laravel 10–12 / Vite / Tailwind
- WebComponent autonome (CDN)
- Aucun cookie déposé par défaut
---
``bash`
pnpm add @n-ramos/cookie-consent
`js`
import { initCookieWall } from '@n-ramos/cookie-consent';
`html`
defer
src="https://unpkg.com/@n-ramos/cookie-consent@1.0.2/dist/cookie-consent-standalone.js"
>
---
`js
const client = initCookieWall({
storageKey: 'my-consent',
categories: [
{ key: 'essential', title: 'Essentiels', required: true },
{ key: 'analytics', title: 'Analytics', googleConsentMode: 'analytics_storage' },
],
vendors: { googleConsentMode: { enabled: true } },
});
if (!client.hasStoredConsentForCurrentVersion()) {
client.open();
}
`
---
`ts`
{
storageKey?: string;
categories: ConsentCategoryConfig[];
vendors?: VendorConfig;
cookieCleanup?: CookieCleanupConfig;
ui?: CookieWallUIConfig;
}
---
`ts`
{
key: string;
title: string;
description?: string;
required?: boolean;
googleConsentMode?: string | string[];
}
---
`ts`
vendors: {
googleConsentMode?: {
enabled: boolean;
}
}
---
`ts`
cookieCleanup: {
analytics: ["_ga", "_gid", "_clck"],
ads: ["IDE", "_fbp"]
}
---
`ts`
ui: {
texts: {
title?: string;
description?: string;
acceptAllLabel?: string;
rejectAllLabel?: string;
customizeLabel?: string;
}
}
---
`ts`
ui: {
classes: {
backdrop?: string;
container?: string;
title?: string;
description?: string;
buttonPrimary?: string;
buttonSecondary?: string;
buttonGhost?: string;
categoryCard?: string;
toggleTrackOn?: string;
toggleTrackOff?: string;
toggleKnob?: string;
advancedContainer?: string;
}
}
---
`html`
---
`ts``
client.open();
client.close();
client.getState();
client.hasStoredConsent();
client.hasStoredConsentForCurrentVersion();
client.reset();
---
- docs/CONFIG_REFERENCE.md
- docs/INTEGRATIONS.md
---
MIT © Nicolas Ramos