npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xms-ai/real-cookies

v1.1.2

Published

XMS Cookies — GDPR/UK GDPR/LGPD/PIPEDA compliant cookie consent banner. Vanilla JS, Supabase integration.

Readme

@xms-ai/real-cookies

Lightweight, GDPR / UK GDPR / LGPD / PIPEDA-compliant cookie consent banner for vanilla JavaScript projects. No dependencies. Optional Supabase integration for cross-device persistence.

npm License: MIT


Features

  • Auto-detect jurisdiction — uses IP geolocation to show GDPR, UK GDPR, LGPD, or PIPEDA UI
  • Granular consent — per-category toggles (Necessary, Functional, Analytics, Marketing)
  • Supabase sync — stores consent records in your Supabase DB (free tier compatible)
  • Zero runtime deps — vanilla JS, no jQuery, no frameworks
  • Google Consent Mode v2 — automatically calls gtag('consent', 'update', …)
  • Accessible — ARIA roles, keyboard navigation, focus-visible outlines
  • Customizable — brand color, logo, dark/light theme, bottom/top/popup position

Installation

npm install @xms-ai/real-cookies

Or via CDN:

<script src="https://cdn.jsdelivr.net/npm/@xms-ai/real-cookies/dist/cookie-consent.min.js"></script>

Quick Start

ESM (npm)

import CookieConsent from '@xms-ai/real-cookies';

await CookieConsent.init({
  companyName:  'Acme Corp',
  primaryColor: '#1a73e8',
  privacyUrl:   '/privacy',

  // Optional: Supabase persistence
  supabaseUrl:  'https://xxxx.supabase.co',
  supabaseKey:  'your-anon-public-key',
});

Script tag

<script src="dist/cookie-consent.min.js"></script>
<script>
  CookieConsent.init({
    companyName: 'Acme Corp',
    privacyUrl:  '/privacy',
  });
</script>

All Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | companyName | string | 'Our Company' | Name shown in the banner | | companyLogo | string | null | URL to a logo image | | primaryColor | string | '#1a73e8' | Brand color for buttons/toggles | | theme | 'light'\|'dark' | 'light' | Banner color scheme | | position | 'bottom'\|'top'\|'popup' | 'bottom' | Banner placement | | privacyUrl | string | '#' | Link to your Privacy Policy | | cookiePolicyUrl | string | null | Link to your Cookie Policy | | supabaseUrl | string | null | Supabase project URL | | supabaseKey | string | null | Supabase anon public key | | categories | object | see below | Override/add cookie categories | | autoShow | boolean | true | Auto-show banner when no consent | | cookieExpiry | number | 365 | Days until re-consent required | | forceMode | string | null | Force compliance mode ('GDPR', 'UK_GDPR', 'LGPD', 'PIPEDA', 'BASIC') |


JavaScript API

// Check consent for a category
if (CookieConsent.hasConsent('analytics')) {
  // load analytics
}

// Get full consent object
const consent = CookieConsent.getConsent();
// { type: 'custom', categories: { necessary: true, analytics: false, … }, … }

// Open settings panel programmatically
CookieConsent.openSettings();

// Reset consent and re-show banner
CookieConsent.resetConsent();

// Listen for consent events
window.addEventListener('vc:consent', (e) => {
  console.log('User decision:', e.detail.type); // 'accept_all' | 'reject_all' | 'custom'
  console.log('Categories:', e.detail.categories);
});

// Per-category events
window.addEventListener('vc:consent:analytics', (e) => {
  if (e.detail.enabled) initGoogleAnalytics();
});

Supabase Setup

  1. Open your Supabase SQL Editor
  2. Run the contents of supabase-schema.sql
  3. Pass your project URL and anon key to init()

The schema creates a cookie_consents table with Row Level Security enabled so anonymous users can only manage their own records.


Compliance Modes

| Mode | Triggered for | Behavior | |------|--------------|---------| | GDPR | EU / EEA / Switzerland | Opt-in, Reject All required, granular controls | | UK_GDPR | United Kingdom | Same as GDPR | | LGPD | Brazil | Opt-in, Portuguese text, granular controls | | PIPEDA | Canada | Opt-out model, granular controls | | BASIC | Rest of world | Simple notice, no reject button |


Custom Categories

CookieConsent.init({
  categories: {
    analytics: {
      name: 'Analytics',
      description: 'Help us understand how visitors use the site.',
      required: false,
      cookies: [
        { name: '_ga', domain: '.google.com', duration: '2 years', type: 'HTTP', description: 'Google Analytics' },
      ],
    },
    // Add entirely new categories:
    preferences: {
      name: 'Preferences',
      description: 'Remember your settings like language and region.',
      required: false,
      cookies: [],
    },
  },
});

Building from Source

npm install
npm run build
# → dist/cookie-consent.js       (IIFE, readable)
# → dist/cookie-consent.min.js   (IIFE, minified)
# → dist/cookie-consent.esm.js   (ES module)

Watch mode:

node build.js --watch

License

MIT © XMS Ai