ConsentLayer

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?

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.

Understanding what happens at each step:

  1. Visitor arrives — The banner script loads and checks for an existing cl_consent cookie
  2. Banner displays — If no consent cookie exists, the banner appears with your configured template, position, and text
  3. Scripts are blocked — Third-party tracking scripts are intercepted and held until consent is given
  4. Visitor chooses — They accept all, reject all, or customize by category (essential, statistics, marketing)
  5. Consent is stored — A cl_consent cookie is set with their choices, jurisdiction, and timestamp
  6. Scripts are released — Approved category scripts are unblocked and execute normally
  7. 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.