npm install -g @trustyourwebsite/cookie-consent-validator
# Run directly with npx (no install needed)
npx @trustyourwebsite/cookie-consent-validator https://example.com
# Or install globally
npm install -g @trustyourwebsite/cookie-consent-validator
cookie-consent-validator https://example.com
Changelog
1.2.0 2026-07-12
Added
localStorage / sessionStorage tracking: web-storage keys matching known tracker patterns that appear or persist after "Reject All" are now reported as violations. Previously only HTTP cookies were checked, so storage-based tracking could slip through as a false pass.
--cmp-delay <ms> flag to control how long to wait for the consent banner to load (was a hardcoded 2s).
Changed
After a successful "Reject All", the scanner now waits for the banner to actually be dismissed before measuring the post-rejection state, reducing timing-related false negatives.
Stricter CLI validation for --format and --timeout.
The library entry point can now be imported without launching a browser (CLI runs only when invoked directly).
Publishing hardened: npm provenance attestation on release, a conditional exports map, prepublishOnly now runs lint + tests + build, and CI runs a non-blocking dependency audit.
Removed
Dropped the misleading playwright keyword — the package uses Puppeteer.
1.1.1 2026-05-20
Changed
Switched the author email and all TrustYourWebsite links to the canonical trustyourwebsite.com domain.
Docs
Added a GitHub Pages landing page.
1.1.0 2026-04-19
Added
Usercentrics CMP detection: detects Usercentrics consent banners and clicks "Reject All" via shadow DOM piercing. Usercentrics was listed in package keywords but had no detection code — now fully supported.
8 new tracker domains: YouTube, Reddit Analytics, Reddit Ads, Amazon Ads, Crazy Egg, VWO (Visual Website Optimizer), plus googlevideo.com and assoc-amazon.com.
Navigation retry logic: page loads now retry up to 3 times with exponential backoff (1s, 2s) on timeout and network errors. CMP-heavy pages are inherently slow — this dramatically improves reliability.