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

@modernconsent/vendors

v1.0.0

Published

Built-in vendor implementations for ModernConsent

Downloads

84

Readme

@modernconsent/vendors

24 built-in vendor modules for ModernConsent. Each vendor is lazy-loaded on demand — zero vendor code is bundled unless activated.

All vendors include fr/en translations for purpose labels (used in displayMode: 'purpose').

Install

npm install @modernconsent/vendors

Usage

With npm (recommended)

import { useBuiltinVendors } from '@modernconsent/vendors';

useBuiltinVendors();

window.modernConsent('vendor', {
  name: 'google-analytics',
  config: { measurementId: 'G-XXXXXXXXXX' },
});

With CDN

Host vendor files on your CDN and set cdnBase:

window.modernConsent('config', {
  cdnBase: 'https://cdn.example.com/mc-vendors',
});

// Fetches https://cdn.example.com/mc-vendors/google-analytics.js
window.modernConsent('vendor', {
  name: 'google-analytics',
  config: { measurementId: 'G-XXXXXXXXXX' },
});

Built-in Vendors

| Key | Name | Config | Consent | | ------------------ | ------------------ | ------------------------------------------ | ---------------- | | google-analytics | Google Analytics | measurementId: string | Required | | gtm | Google Tag Manager | containerId: string | Required | | matomo | Matomo | siteId: string, trackerUrl: string | Required | | clarity | Microsoft Clarity | projectId: string | Required | | hotjar | Hotjar | siteId: string | Required | | hubspot | HubSpot | portalId: string | Required | | amplitude | Amplitude | apiKey: string | Required | | piano-analytics | Piano Analytics | siteId: string, collectDomain?: string | Required | | posthog | PostHog | apiKey: string, instance?: string | Required | | sentry | Sentry | dsn: string, version?: string | Required | | abtasty | AB Tasty | accountId: string | Required | | segment | Segment | writeKey: string | Required | | plausible | Plausible | domain: string, instanceUrl?: string | Not required |

| Key | Name | Config | Consent | | ------------------ | ------------------------- | ---------------------------- | -------- | | googleads | Google Ads | tagId: string | Required | | gcmads | Google Ads (Personalized) | (auto-linked by googleads) | Required | | meta-pixel | Meta Pixel | pixelId: string | Required | | linkedin-insight | LinkedIn Insight Tag | partnerId: string | Required | | tiktok-pixel | TikTok Pixel | pixelId: string | Required | | criteo | Criteo | accountId: string | Required | | pinterest-pixel | Pinterest Tag | tagId: string | Required | | snapchat-pixel | Snapchat Pixel | pixelId: string | Required | | reddit-pixel | Reddit Pixel | pixelId: string | Required |

| Key | Name | Config | Consent | | ----------- | --------- | --------------- | -------- | | intercom | Intercom | appId: string | Required | | smartsupp | Smartsupp | key: string | Required |

Custom Vendors

You don't need this package for custom vendors. Register them inline:

window.modernConsent('vendor', {
  name: 'my-tracker',
  label: 'My Tracker',
  description: 'Our internal analytics tool.',
  category: 'Analytics',
  requireConsent: true,
  artifacts: ['_mt_id', '_mt_session'],
  setup(config) {
    // Runs at page load (e.g. set consent defaults)
  },
  init(config) {
    // Runs when consent is granted
    const s = document.createElement('script');
    s.src = 'https://example.com/tracker.js';
    document.head.appendChild(s);
  },
});

Vendor Lifecycle

Each vendor can implement two hooks:

| Hook | When | Use case | | --------------- | --------------------------- | -------------------------------------------------------------- | | setup(config) | Immediately at registration | Set consent defaults (e.g. Google Consent Mode default deny) | | init(config) | When consent is granted | Load scripts, initialize SDKs |

In Consent-Only mode (consentOnly: true), init() is never called — only setup() runs.

Related Packages

| Package | Description | | ------------------------------------------------------------------------------ | ----------------------------------------- | | @modernconsent/core | Consent engine, state, events, cookie | | @modernconsent/widget | Web Component UI (banner + details panel) |

License

MIT