ConsentLayer
Consent infrastructure for modern web apps. Add a privacy-compliant consent banner, block tracking scripts until consent is given, and manage everything through a clean API or AI coding agents.
What can you build?
Add a consent banner
Drop in a script tag and get a fully compliant banner on any site in under 5 minutes.
Control consent in React
Use the SDK to gate components behind consent categories with React hooks.
Automate with the API
Create sites, configure banners, trigger scans, and pull consent records programmatically.
Let AI agents configure consent
MCP server lets coding agents like Cursor and Claude Code set up consent without manual steps.
Choose your path
"I just need a consent banner" — Start with the Quick Start. Add a script tag, configure your categories in the dashboard, done.
"I'm building a React or Next.js app" — Follow the Next.js guide or Vite guide, then use ConsentGate to gate components behind consent.
"I need to automate consent setup" — Use the REST API to create sites, configure banners, and trigger scans programmatically. Or point an AI coding agent at the MCP server.
The consent flow
Understanding what happens at each step:
- Visitor arrives — The banner script loads and checks for an existing
cl_consentcookie - Banner displays — If no consent cookie exists, the banner appears with your configured template, position, and text
- Scripts are blocked — Third-party tracking scripts are intercepted and held until consent is given
- Visitor chooses — They accept all, reject all, or customize by category (essential, statistics, marketing)
- Consent is stored — A
cl_consentcookie is set with their choices, jurisdiction, and timestamp - Scripts are released — Approved category scripts are unblocked and execute normally
- Record is created — A consent record is stored via the API for compliance auditing
On return visits, the cookie is read and scripts are managed according to the stored consent — the banner only reappears if the consent version changes.