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

consentify-migrate

v2.1.0

Published

Migrate to Consentify. Removes Cookiebot and tracking scripts, detects integrations, sets up your Consentify domains, and commits the changes. Works on a single project or a whole folder of client sites at once.

Readme

consentify-migrate

Set up Consentify across your projects in one command. The tool detects your framework, removes whatever consent tool you have today (Cookiebot, OneTrust, CookieYes, Iubenda, Usercentrics, and many more, or nothing at all) along with any tracking scripts, detects your existing integrations, creates your domain on Consentify, wires the script into the right place, and commits the changes to git.

It works on a single project, or on a whole folder of client sites at once (bulk mode), which is built for agencies and teams managing many websites.

# Single project (run from the project root)
npx consentify-migrate

# A whole folder of sites
npx consentify-migrate bulk ./clients

No installation needed.


Before you start

You need a Consentify account. Create one at consentify.app. For bulk runs across many domains, make sure your plan has enough domain capacity.


Single project mode

Run the command from your project root. It walks you through:

  1. Detects your framework and the exact entry point to use for it.
  2. Finds your existing consent tool and tracking scripts in your source and removes them. It recognizes the common CMPs (Cookiebot, OneTrust, CookieYes, CookieFirst, Termly, Osano, Iubenda, Usercentrics, Didomi, TrustArc, Civic, Cookie Script, Klaro, Complianz, Borlabs, Quantcast, Sourcepoint, vanilla Cookie Consent). If the site has no CMP yet, it just sets Consentify up fresh. Trackers get re-injected by Consentify after consent.
  3. Detects integrations the same way the dashboard onboarding does: it runs Consentify's live GDPR scanner against your domain and picks up the tools we support (Google Analytics, Google Ads, GTM, Facebook Pixel, PostHog, TikTok, LinkedIn, Snapchat, HubSpot, Contentsquare, Intercom), including ones loaded through GTM. If the site isn't reachable, it falls back to scanning your source code. Every analytics/marketing tracker in your code is stripped so nothing fires before consent. Supported ones are set up on your domain; paid ones are only enabled if your plan includes them (otherwise the tool tells you which to upgrade for), and any tracker we don't have a built-in integration for (e.g. X/Twitter, Reddit, Clarity, Hotjar, Segment) is reported so you can re-add it as a custom integration. Payment and embed scripts (Stripe, PayPal, Klarna, reCAPTCHA, YouTube, Calendly) are left untouched.
  4. Finds your privacy policy by looking for a policy route in the project (privacy, privacy-policy, personvern, cookies, and more, across languages), and uses https://{domain}/{that-path}.
  5. Logs you in to Consentify (credentials are used once and never stored).
  6. Creates your domain and configures the detected integrations via the API.
  7. Injects the Consentify script at the correct location for your framework.
  8. Commits the change to git (see git modes below).

Use --no-scan to skip the live scanner and rely on source-code detection only.


Bulk mode

Point the tool at a folder whose immediate subfolders are individual sites:

npx consentify-migrate bulk ./clients
clients/
  acme.com/            → Next.js (App Router)
  bergen-cafe/         → WordPress
  nordic-shop.no/      → Vue
  ...

For each project it detects the framework, resolves the domain, scans for integrations, sets up Consentify, strips trackers, injects the script, and commits + pushes on a dedicated branch. Failures on one project never stop the rest of the batch. At the end you get a consentify-migration-report.md (and .json) in the folder with every domain, token, and anything that needs manual follow-up.

Before it starts, the run checks your plan's domain capacity. If the folder has more sites than you have room for, it tells you up front and (with your confirmation) sets up as many as fit, rather than failing partway through. The rest are listed in the report as skipped for capacity.

Resolving domains

Each site needs a domain. The tool resolves it in this order:

  1. Manifest file (recommended for large batches), matched by folder name.
  2. Folder name, if the folder is itself a domain (e.g. acme.com).
  3. Git remote, if the repo name is a domain.
  4. Prompt, for anything still unresolved (unless --yes).

Manifest as CSV:

folder,domain,policyUrl
acme-site,acme.com,https://acme.com/privacy
bergen-cafe,bergen-cafe.no,

or JSON:

{ "acme-site": "acme.com", "bergen-cafe": "bergen-cafe.no" }
npx consentify-migrate bulk ./clients --manifest ./domains.csv --yes

Git modes

By default every project is committed on a dedicated consentify-setup branch and pushed, so nothing lands on main without review. Only the files the tool changed are staged, so any pre-existing uncommitted work is left alone.

| Flag | Behavior | | ---------------- | --------------------------------------------------------------- | | --git=branch | Create consentify-setup branch, commit, push (default). | | --git=push | Commit on the current branch and push. | | --git=commit | Commit only, no push. | | --git=none | Make file changes only, no git. |


Options

| Flag | Description | | --------------------------- | ---------------------------------------------------------------- | | bulk [dir] / --all | Bulk mode over a folder of projects (default dir: cwd). | | --manifest <file> | CSV or JSON folder to domain mapping. | | --policy-pattern "<p>" | Fallback privacy policy URL if none detected, {domain} substituted. | | --git=<mode> | Git behavior (see above). | | --no-scan | Skip the live scanner; detect integrations from source only. | | --dry-run | Detect and report only. No API calls, file writes, or git. | | --yes / -y | Skip confirmation prompts (requires resolvable domains). |

Example, non-interactive agency run:

npx consentify-migrate bulk ./clients \
  --manifest ./domains.csv \
  --policy-pattern "https://{domain}/personvern" \
  --git=branch --yes

Supported frameworks

Each framework gets the script placed where it actually belongs, not just anywhere.

| Framework | Where the script goes | | ---------------------- | ------------------------------------------------------- | | Next.js (App Router) | Root layout <body> via next/script | | Next.js (Pages Router) | pages/_document (created if missing) | | React (CRA / Vite) | index.html before </body> | | Vue | index.html before </head> | | Nuxt | Generated client plugin using useHead | | SvelteKit | src/app.html | | Svelte (Vite) | index.html | | Astro | Base layout <head> | | Angular | src/index.html | | WordPress | Theme header.php before wp_head() | | Vanilla HTML | index.html before </body> |

Re-running is safe: if Consentify is already present in a project, it is skipped.


Supported integrations

Google Analytics, Google Tag Manager, Facebook Pixel, PostHog, TikTok Pixel, LinkedIn Insight Tag, Snapchat Pixel, HubSpot, Contentsquare, Intercom.

Integrations that are detected but whose ID could not be extracted are flagged in the report to configure manually in the dashboard.


After the migration


Requirements