Socket
Book a DemoInstallSign in
Socket

@dorsium/gdpr

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dorsium/gdpr

Lightweight GDPR & Cookie Consent module for Next.js projects. Built by Dorsium

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
10
-98.85%
Maintainers
1
Weekly downloads
 
Created
Source

@dorsium/gdpr

npm version GitHub

Lightweight GDPR & Cookie Consent module for Next.js projects. Built by the Dorsium Foundation.

Features

  • 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

Installation

npm install @dorsium/gdpr

Usage

1. Add the CookieConsent component (e.g. to _app.tsx or layout)

import { CookieConsent } from "@dorsium/gdpr";

export default function App({ Component, pageProps }) {
  return (
    <>
      <Component {...pageProps} />
      <CookieConsent />
    </>
  );
}

2. Use the useConsent() hook to check preferences

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;
}

3. Optional: Show the Dorsium badge

import { PoweredByDorsiumBadge } from "@dorsium/gdpr";

export default function Footer() {
  return (
    <footer className="text-center mt-8">
      <PoweredByDorsiumBadge />
    </footer>
  );
}

Configuration

No configuration needed. Automatically saves user choices under localStorage['dorsium_consent'].

Only two boolean values are stored:

  • analytics
  • marketing

These flags are kept indefinitely in localStorage until you clear them. No personal data is stored.

Build

npm run build

License

This project is licensed under the MIT License.

© Dorsium — https://dorsium.com

Powered by Dorsium

🔗 View on NPM
🔗 Source on GitHub

Keywords

gdpr

FAQs

Package last updated on 08 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts