cookieconsent's export notice invokes an Apache Software Foundation exception while the project is MIT, and its README recommends against itself
A free solution to the EU, GDPR, and California Cookie Laws
At a glance
- What is it?
- osano/cookieconsent is an MIT-licensed JavaScript consent banner whose manifest says 4.0.0, whose newest GitHub tag is 3.1.1 from 2019, and whose install lines still pin version 3. Last push to the dev branch is 2026-08-11. The version split, the export control notice and the commercial pitch are all in the file.
- Who is it for?
- cookieconsent is a reasonable choice for a static site that needs a consent banner and wants no vendor, because it has no runtime dependencies and the compliance types it supports cover most of what regulators ask for. Two things to check before you build on it.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 106 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- osano/cookieconsent3,591 ★ · +15
| Repository | 2026-09-24 | 2026-11-25 |
|---|---|---|
| osano/cookieconsent | 3.6k | 3.6k |
15 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The install pins version 3 and the manifest says 4.0.0
There are five installation routes in this README, and they do not agree about which version you get.
The first is a wizard hosted on the vendor's site. Then npm:
npm install cookieconsentThen Yarn, selecting major version 3:
yarn add cookieconsent@3Then Bower. The CDN example likewise selects major version 3:
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js"></script>Neither @3 reference specifies an exact package version; use an exact version and verify integrity when reproducibility matters.
Now put that against the package manifest, which declares version 4.0.0, and against the release list, where the newest tag is 3.1.1 from May 2019 and the two before it are from 2018.
So the version the README documents in its usage section, the version the manifest declares, and the version two of the five install commands fetch are three different things. A developer who installs by following the CDN line and then reads the usage section above it is following 4.0 documentation against a 3.x artefact.
The release script in the manifest bumps the version in the package file, the lockfile and the Bower file, which explains how 4.0.0 exists without a tag: the number was bumped locally and the tag was never cut.
The module is imported as CookieConsent and the package is cookieconsent
The usage section shows three ways to get hold of the object, and one of them is not the name of the package.
For a bundler, it is imported from a specifier with a capital C:
import CC from "CookieConsent"
// or
const CC = require( "CookieConsent" )For the classic browser build, it is read off the global object as the same capitalised name.
The package name in every install command is lowercase. So a bundler resolving the package by its own name will not find what the example imports, and the mismatch is one capital letter.
That is the whole class of error people hit with this library: the module identifier and the distribution name differ in case, which works on a case-insensitive filesystem or a case-insensitive registry path and fails on a strict one. It is a small thing and it is the kind of thing that costs an afternoon.
The global form is the escape hatch, and it is the reason the classic build still exists alongside the module builds.
Version 4 removed the callbacks and replaced them with six named events
The sentence that matters for an upgrade is in the usage section, and it is short: the initialization style has changed, and so have the callbacks, which are gone.
What replaced them is an event interface. Six events are named in the file: initialized, error, popupOpened, popupClosed, revokeChoice and statusChanged.
So a 3.x integration that registered callbacks for showing, accepting and revoking the banner has to be rewritten as listeners on those names. The semantic mapping is close, since the events cover the same lifecycle points, but the mechanism and the names are different, and there is no compatibility shim mentioned.
The file acknowledges the scale of the change with a heading of its own for version 4.0 and one sentence about it: lots of updates and some breaking changes, with a promise attached.
The earlier major is better documented. Version 3.0 was a complete rewrite from version 2 and its feature list is specific: geolocation so the banner only appears in the relevant countries, callback hooks for the three banner actions, support for different compliance types, and themes. Those four features are the reason the library exists, and the compliance-types one is why the examples directory has separate files for informational, opt-out and opt-in.
The export notice claims an Apache Software Foundation distribution
There is a section at the end of the file about export control, and it contains a claim that does not match the repository.
It says the distribution includes cryptographic software, and that the US Department of Commerce Bureau of Industry and Security has classified the software under a specific export control number for information security software using cryptographic functions with asymmetric algorithms.
It then says that the form and manner of this Apache Software Foundation distribution makes it eligible for export under the TSU exception for both object code and source code, citing a section of the export regulations.
This project is MIT licensed, it is not part of the Apache Software Foundation, and the licence file it ships is the MIT one. The TSU exception is a foundation mechanism for foundation projects.
Which means the notice is boilerplate carried over from a template, and in a cookie banner it is hard to see what cryptographic function with an asymmetric algorithm is being performed. There is no cryptography in the feature list, the dependency list has no runtime dependencies at all, and the examples are HTML files.
For anyone doing export compliance work this is the kind of inherited paragraph that causes a question in an audit, and it is a reminder to read the licence text rather than the surrounding notices.
The README argues most site owners should use the hosted product instead
The section on the hosted platform is the most direct thing in the file, and it is a sales pitch that happens to be honest.
It opens by making the case for open source properly: using any open source consent manager means you have to do geolocation lookups yourself, adjust the consent types by visitor location, call back and store consents in a database, and write callbacks that load scripts once consent is granted. Four concrete pieces of work, listed plainly.
Then the recommendation, stated plainly: unless you specifically need the open source tool, most website owners will be better served by the hosted version.
That is a project README recommending its own commercial product over the code in the repository, and the paragraph that follows makes the incentive explicit, pointing readers to paid plans as a way of supporting development.
It works because the argument is true. A consent banner is the easy part; storing consent records, keeping them across visits, and blocking third-party scripts until consent are the parts with real engineering in them. The hosted version lists four capabilities the open source one does not have, including translation into 38 languages, consent records stored on a blockchain with a REST interface for browsing them, and a dashboard so a marketing team can toggle scripts without a developer.
The list ends mid-sentence, on a bullet about global edge hosting, so the fourth capability is incomplete in this version of the file.
The development server command only works on Python 2
The contributing section is four lines and it tells you how to develop, which is unusually direct for a project this size.
It invites pull requests, and then says the easiest way to develop is to host the files with a local web server, giving this as the example:
python -m SimpleHTTPServerThat module only exists in Python 2. The Python 3 equivalent is a different module with a different name, and the README does not mention the difference. On a current machine the command fails immediately.
The rest of the build story is coherent and well specified. The file names its three compile stages: Babel for the source, Terser for minification, and PostCSS for the styles. The SCSS is compiled and the JavaScript is minified, with the configuration split across separate files for Babel, PostCSS, Terser and three webpack configurations covering development, production and shared settings.
The build scripts follow the same shape. One cleans the output directory, one runs the development configuration, one cleans and then runs the production configuration, and one is the release script, which builds and then bumps the version in three files at once.
A Sass cache directory and a .DS_Store are committed
The repository root contains a cache directory.
There is a hidden directory for the Sass cache, checked in alongside the source, the build output and the configuration. A cache is by definition derived data: it is regenerated on the next compile and should not be versioned, and having it committed means every contributor's local state changes the same tracked files.
There is a second one further down. The examples directory contains a macOS metadata file, which Finder creates when someone browses the folder in a file dialog. That file is tracked too.
Neither is dangerous, and both are ordinary signs of a repository that has been worked in rather than curated by someone who ran a housekeeping pass. They are worth mentioning because this is the same repository whose build output directory is also committed, which is a deliberate choice for a library that ships a prebuilt bundle.
That last point is deliberate and worth separating out. The package entry point is the minified file inside the build directory, so consumers install a prebuilt artefact rather than compiling anything. Combined with no runtime dependencies at all, that makes the installed package a single file, which is a genuine virtue for a banner that goes on every page of a site.
The scale claim is unsourced and the tooling is from 2019
Two things to weigh when reading this file.
The first is the scale claim, which is the only number in it: the project says it is seen over two billion times every month and used on millions of sites, which it calls the most popular consent project on the internet. There is no source, no methodology and no way to check it from the file.
Taken at face value it explains why a vendor would fund maintenance of a free banner: it is the on-ramp. That is a coherent business model rather than a red flag, and the disclosure of venture backing and a benefit corporation status in the hosted section makes the arrangement explicit rather than hidden.
The second is the age of the development tooling. The manifest's build dependencies are a 2019 generation: a Babel 7.5 toolchain, webpack 4, Jest 24, the Node Sass bindings at 4.12, and a PostCSS command-line tool at 6.1. Three are pinned with a caret at that minor version, and one Babel plugin is pinned exactly. The build file is still a single JavaScript configuration file with no type checking and no lockfile discipline beyond the one lockfile.
The last push to the default branch is dated 2026-08-11, so the source has been touched recently while the toolchain has not. The default branch is also named dev rather than main, which means a clone gives you the development line.
Editorial conclusion
cookieconsent is a reasonable choice for a static site that needs a consent banner and wants no vendor, because it has no runtime dependencies and the compliance types it supports cover most of what regulators ask for. Two things to check before you build on it. Resolve the version split yourself, since the manifest, the tags and the install instructions do not agree and the callbacks API was removed in the major you are probably reading about. And read the hosted product section, because the project itself argues that most site owners are better served by the commercial version, which changes what you are getting by self-hosting.
Frequently asked questions
What is cookieconsent?
A lightweight JavaScript plugin that shows visitors a cookie notice, intended to help a site comply with the EU cookie law, CCPA, GDPR and similar rules. It has no runtime dependencies and ships as a single prebuilt bundle.
Which version of cookieconsent should I install?
That is unresolved in the repository. The package manifest declares 4.0.0, the newest GitHub tag is 3.1.1 from May 2019, and the Yarn and CDN install lines both pin major version 3, while the usage section documents the 4.0 API with events replacing callbacks.
How do I install cookieconsent?
Five routes are listed: a hosted wizard, npm, Yarn, Bower and a script tag from a CDN. Two of them pin major version 3. The package entry point is the minified file in the committed build directory.
What do I have to build myself with cookieconsent?
The README says that with any open source consent manager you need to do geolocation lookups, adjust consent types by visitor location, store consents in a database with callbacks, and load scripts after consent. Those four are what the hosted product is selling.
Is the cookieconsent export control notice accurate?
It appears to be inherited boilerplate. It classifies the software under an information-security export control number for asymmetric cryptography and cites an Apache Software Foundation exception, while the project is MIT licensed, is not part of that foundation and has no runtime dependencies.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/osano-cookieconsent)Star history chart for your README
[](https://hysenlabs.com/projects/osano-cookieconsent)Was this useful?