MIT selection GDPR and privacy

Cookie consent

orestbida/cookieconsent

A lightweight JavaScript plugin, written without a framework, that shows a cookie consent banner and blocks the relevant scripts until the visitor has given consent.

A panel of blue-lit switches, one of them magnified by a glass lens.
Author
orestbida
Language
JavaScript
Licence
MIT
GitHub stars
5,718
Last activity
Category
GDPR and privacy

Licence checked on 25/10/2026. Stars and last activity recorded on GitHub on the same date.

Overview

CookieConsent v3 is a cookie consent plugin written in plain JavaScript. According to its documentation it manages scripts, and therefore cookies, by blocking them until the visitor gives explicit consent, and it integrates into any web platform or framework. The documentation gives examples for HTML, React, Vue and Angular.

The documentation also states its limits: the plugin requires basic JavaScript knowledge, has no default categories or translations, is not a consent management platform (CMP), does not store consent records and does not implement the IAB TCF framework. A playground lets you try the plugin.

Highlights

  • A lightweight plugin in plain JavaScript, described in the README as GDPR compliant (the documentation also mentions CCPA).
  • Blocks scripts until explicit consent is given and provides opt-out options, according to the documentation.
  • Version 3 supports individually togglable services and offers UMD and ESM variants; it targets modern browsers only.
  • Three ways to install (npm, CDN, release download) and integration examples for HTML, React, Vue and Angular.
  • The documentation states it can be controlled by keyboard and screen readers; a playground and Stackblitz examples are provided.

Who it is for

For developers who want to add a cookie consent banner to a site themselves, with full control over configuration and without a consent management platform.

Installation

The README points to the documentation. It offers npm, yarn or pnpm, a CDN link, or downloading the latest release, then a configuration to pass to CookieConsent.run().

Commands

Read the project README before running these commands.

npm i vanilla-cookieconsent@3.1.0

Read the README on GitHub

Points of attention

  • It is not a consent management platform (CMP): it does not store consent records and does not implement the IAB TCF.
  • It requires basic JavaScript knowledge and has no default categories or translations: texts and categories must be defined in the configuration.
  • Google AdSense, Ad Manager and AdMob no longer work with CookieConsent since January 2024, according to the documentation.

Can an agent use it?

A conventional JavaScript plugin for websites. No SKILL.md, AGENTS.md, CLAUDE.md, Cursor rules or MCP server found at the repository root.

Likes and comments

No account needed: one like per browser, which you can remove. Comments are published after review.

This project is hosted by its author: your comments are about this page, not the code. To report an issue with the project, use its repository.

MIT selection

Cookie-free analytics

umami-software/umami

Privacy-friendly website analytics, no cookies, self-hosted.

MIT selection

GDPR and AI Act compliance skills

better-isms/grcskills

Around sixty compliance skills (DPIA, AI Act, policies, incidents); a human keeps every decision.

Made by SOGNI DIGITALI

Complete design system

design-system-builder

One interactive multilingual page plus the design.md file your coding agents read.

A custom skill for your trade?

We also write private skills, in your name. Let's talk about it on a 30-minute call.

Book the free call (30 min)