Skip to content

Latest commit

 

History

History
72 lines (52 loc) · 1.35 KB

File metadata and controls

72 lines (52 loc) · 1.35 KB

Getting Started

Installation

Via npm (recommended)

npm install @synapxlab/cookie-consent

Via yarn

yarn add @synapxlab/cookie-consent

Via CDN

<script src="https://cdn.jsdelivr.net/npm/@synapxlab/cookie-consent@2.1.3/dist/cookie.min.js"></script>

Basic Usage

1. Simple import

// In your main JS file
import '@synapxlab/cookie-consent';

2. Minimal configuration

// No configuration required!
// The banner displays automatically on page load

3. With configuration

window.CookieConsent.init({
  statistics: {
    google_analytics_key: 'G-XXXXXXXXX'
  },
  marketing: {
    facebook_pixel: {
      key: 'YOUR-PIXEL-ID',
      track: 'PageView'
    }
  }
});

Verification

Open your browser and you should see:

  • ✅ Consent banner appears on first load
  • ✅ Third-party scripts (Analytics, pixels) are blocked by default
  • ✅ Preferences are saved after acceptance

Next Steps

Need Help?