React / Next.js + Strapi v5 and v4 plugins

Cookie Consent

A free, full-stack GDPR cookie consent solution for React / Next.js and Strapi: Google Consent Mode V2, CNIL compliance, WCAG 2.1 AA accessibility and consent proof logging.

Illustration of a cookie on a platform with a protective shield and consent toggle switches

Most cookie consent tools are either paid SaaS (Axeptio, Cookiebot, OneTrust) or client-side only, with no proof logging. This open source solution covers the full stack with no third-party service and no subscription fees.

The banner and preferences modal integrate on the React side, and the Strapi plugin logs every consent choice in a dedicated collection, created automatically.

Features

  • React banner and preferences modal with full keyboard accessibility (modal dialog, focus trap, Escape to close)

  • Google Consent Mode V2 (Advanced) built in, with correct signal mapping per category

  • CNIL-compliant out of the box: 13-month expiry, no pre-checked boxes, Refuse all as visible as Accept all, anonymized IP

  • First-party cookie only, zero third-party cookies before explicit consent

  • Strapi logging plugin: auto-created collection, auto-configured rate-limited public POST endpoint, admin-only reads

  • Blocked content facades: YouTube (nocookie domain), Google Maps and a generic wrapper, with one-click activation

  • useConsent hook to drive consent from your components (accept, refuse, open preferences, query a category)

  • Visual customization through CSS custom properties

  • WCAG 2.1 AA accessibility: contrast ratios of at least 4.5:1, touch targets of at least 44 by 44 pixels, full keyboard navigation

Compatibility

  • React 18 or later, Next.js App Router
  • Strapi v5 (^5.0.0) via strapi-plugin-cookie-consent
  • Strapi v4 (^4.0.0) via strapi-plugin-cookie-consent-v4

Install

React components

npm install @isomorph-agency/cookie-consent

Strapi v5 plugin

npm install strapi-plugin-cookie-consent

Strapi v4 plugin

npm install strapi-plugin-cookie-consent-v4

npm packages

PackageVersionRole
@isomorph-agency/cookie-consent1.0.5React components and TypeScript core
strapi-plugin-cookie-consent1.0.3Strapi v5 plugin
strapi-plugin-cookie-consent-v41.0.2Strapi v4 plugin

Our other plugins