Lightweight GDPR & Cookie Consent module for Next.js projects. Built by the Dorsium Foundation.
- GDPR-compliant cookie consent banner
- Categorized: Necessary, Analytics, Marketing
- Remembers preferences via
localStorage - Fully reusable NPM module
useConsent()hook for conditional logic- Styled with Tailwind CSS
- Powered by Dorsium branding included
npm install @dorsium/gdprimport { CookieConsent } from "@dorsium/gdpr";
export default function App({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<CookieConsent />
</>
);
}import { useConsent } from "@dorsium/gdpr";
export default function AnalyticsLoader() {
const { hasConsent } = useConsent();
useEffect(() => {
if (hasConsent("analytics")) {
// Load Google Analytics or other trackers here
}
}, [hasConsent]);
return null;
}import { PoweredByDorsiumBadge } from "@dorsium/gdpr";
export default function Footer() {
return (
<footer className="text-center mt-8">
<PoweredByDorsiumBadge />
</footer>
);
}No configuration needed. Automatically saves user choices under localStorage['dorsium_consent'].
Only two boolean values are stored:
analyticsmarketing
These flags are kept indefinitely in localStorage until you clear them. No personal data is stored.
npm run buildThis project is licensed under the MIT License.
© Dorsium — https://dorsium.com