Framework Integration

Mount the c15t consent backend in any JavaScript framework or runtime.

The c15t backend exposes a single handler with the signature (request: Request) => Promise<Response>. This is the standard Fetch API, so it works with any runtime that supports it — Node.js, Bun, Deno, and Cloudflare Workers.

Bun

Next.js (App Router)

Create a catch-all API route that forwards requests to the handler:

Info

Use Next.js rewrites to proxy frontend requests through the same domain and avoid ad-blocker issues. See the Next.js Quickstart for the rewrite configuration.

Hono

Express

Fastify

Cloudflare Workers

Deno

CORS

The backend automatically handles CORS based on the trustedOrigins you configure:

Features:

  • www variants are automatically allowed
  • Wildcard subdomain matching with *
  • localhost is allowed in development
  • Preflight OPTIONS requests are handled automatically