Skip to content

Edge proxy setup

The proxy ships as the npm package @lightning-cmp/edge-proxy. You deploy a thin Worker that re-exports it.

  1. Your domain on Cloudflare. The proxy is a Cloudflare Worker, so the zone must be on Cloudflare.

  2. Copy the template. From the package’s template/ directory, set your Worker name, the route, and your LICENSE_KEY.

  3. Choose the route scope:

    • Scoped — yourdomain.com/__consent/* — runs only the first-party proxy.
    • Whole-zone — yourdomain.com/* — also enables tracker auto-gating and the cookie guard.
  4. Deploy: wrangler deploy (the template’s pnpm deploy).

  5. Point your embed at the first-party path:

    <script src="https://yourdomain.com/__consent/v1/cmp.js?k=YOUR_LICENSE_KEY" async></script>
Terminal window
curl -s "https://yourdomain.com/__consent/v1/cmp.js?k=YOUR_LICENSE_KEY" | head -1

You should see the baked license with "apiBase":"https://yourdomain.com/__consent" — confirming subsequent SDK calls route back first-party.