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

strapi-plugin-cookiesregtech

v1.0.0

Published

CookiesRegTech cookie consent: guided connect from the Strapi admin, plus the config endpoint and snippet for the site frontend.

Downloads

26

Readme

CookiesRegTech for Strapi

Cookie consent banner with automatic tracker blocking, Google Consent Mode, a cookie scanner, and a verifiable consent log — powered by CookiesRegTech.

Helps with GDPR, UK GDPR, CCPA/CPRA, LGPD, POPIA, and PIPEDA compliance. Supports Strapi v5 (Node 18+).

Why this plugin works differently

Strapi is headless: it does not render the public website, so this plugin cannot inject the consent banner script by itself the way the WordPress or October CMS plugins do. Instead it gives you everything needed to add it to your frontend in one step:

  1. Guided connect in the Strapi admin — create a free CookiesRegTech account or link an existing one, and see the plan, banner status, last scan, and the detected cookie list.
  2. The exact snippet for your frontend (Next.js, Nuxt, Astro, plain HTML, anything) — one line, ready to paste.
  3. A public config endpoint — GET /api/cookiesregtech/config — so your frontend can read the script URL at build or run time instead of hardcoding it.

Installation

Inside your Strapi project:

npm install strapi-plugin-cookiesregtech

Enable the plugin in config/plugins.js:

module.exports = () => ({
  cookiesregtech: { enabled: true },
});

or config/plugins.ts:

export default () => ({
  cookiesregtech: { enabled: true },
});

Rebuild the admin panel and start Strapi:

npm run build
npm run develop

The package ships prebuilt (dist/ contains both the server and admin parts), so no extra build step is needed for the plugin itself.

Setup

  1. In the Strapi admin, open CookiesRegTech in the main menu.
  2. Enter the public address of your website (for example https://www.example.com). A headless CMS cannot detect this on its own, so it must be the site your visitors actually see — not the Strapi URL.
  3. Confirm the account email, tick the consent box, and press Connect website. A free account is created and the website is registered.

If the email already has a CookiesRegTech account, a confirmation link is sent to it instead — click it, then press Check status in the plugin screen.

Add the banner to your frontend

After connecting, the plugin screen shows your snippet. Place it right after the opening <head> tag, before Google Tag Manager or any analytics script, so it can block trackers and signal Google Consent Mode before anything else runs. Do not add async or defer to it.

Option A — paste the snippet

Copy the line shown in the admin into your site's HTML head:

<head>
  <!-- CookiesRegTech: must be the first script -->
  <script src="PASTE_SCRIPT_URL_FROM_STRAPI_ADMIN"></script>
  <!-- Google Tag Manager, analytics, etc. go below -->
</head>

Option B — read it from the config endpoint

The endpoint returns:

{
  "enabled": true,
  "domainId": "…",
  "server": "…",
  "scriptUrl": "…"
}

First allow public access to it: Settings → Users & Permissions plugin → Roles → Public → Cookiesregtech → config, then save. Without this the endpoint returns 403 Forbidden.

Next.js (App Router) — app/layout.tsx:

async function getConsentConfig() {
  try {
    const res = await fetch(`${process.env.STRAPI_URL}/api/cookiesregtech/config`, {
      next: { revalidate: 3600 },
    });
    return res.ok ? res.json() : null;
  } catch {
    return null;
  }
}

export default async function RootLayout({ children }: { children: React.ReactNode }) {
  const consent = await getConsentConfig();
  return (
    <html lang="en">
      <head>
        {consent?.enabled && consent.scriptUrl && <script src={consent.scriptUrl} />}
        {/* analytics scripts after this line */}
      </head>
      <body>{children}</body>
    </html>
  );
}

Astro — in your base layout:

---
const res = await fetch(`${import.meta.env.STRAPI_URL}/api/cookiesregtech/config`).catch(() => null);
const consent = res?.ok ? await res.json() : null;
---
<html lang="en">
  <head>
    {consent?.enabled && consent.scriptUrl && <script is:inline src={consent.scriptUrl}></script>}
  </head>
  <body><slot /></body>
</html>

The same pattern works for Nuxt (useHead in app.vue), SvelteKit, Gatsby, or any static site generator: fetch the config once, and render the scriptUrl as the first script in the head when enabled is true.

After connecting

The plugin screen shows the account, plan, banner status, and the cookies found by the last scan, plus Open dashboard / Upgrade plan, which open the CookiesRegTech dashboard already signed in. Banner design, cookie scans, languages, and the consent log are managed there and publish to your site instantly — no frontend redeploy needed, since the snippet stays the same.

The free plan includes a working banner, consent logging, and cookie scans; paid plans add scheduled full-site scans, geo-targeted banners, custom CSS, and higher limits. Upgrades happen in the CookiesRegTech dashboard, never inside this plugin.

Troubleshooting

  • Banner not showing — check that the snippet is in the rendered HTML (view source, not dev tools after hydration) and that it comes before other scripts.
  • 403 from /api/cookiesregtech/config — public access to the route has not been enabled (see Option B).
  • Plugin missing from the admin menu — confirm it is enabled in config/plugins.js and that you ran npm run build after installing.

Developing this plugin

Built with the official @strapi/sdk-plugin toolchain:

npm install       # once, inside this folder
npm run build     # bundles server + admin into dist/
npm run watch     # rebuilds on change while linked into a Strapi app
npm run verify    # checks that the package exports resolve

To iterate inside a Strapi app, link this folder (npm install /path/to/this/folder), or use npx yalc or a file: dependency, then run npm run develop in the app.

Support