Quickstart

Self-host the c15t consent management backend in your own infrastructure.

The @c15t/backend package gives you a fully self-hosted consent management API. It handles consent storage, geo-location, audit logging, and policy management — all on your own infrastructure.

The backend exposes a standard (request: Request) => Promise<Response> handler, so it works with any JavaScript runtime (Node.js, Bun, Deno, Cloudflare Workers) and any HTTP framework.

If you want a fully managed experience we recommend using consent.io.

Installation

Basic Setup

Create a c15t instance

The trustedOrigins array controls CORS — list every domain that will send requests to the API.

Mount the handler

The c15t.handler accepts a standard Fetch API Request and returns a Response. Mount it in your framework of choice:

See Framework Integration for more examples.

Run database migrations

Before the backend can store consent records, your database needs the required tables.

The easiest way to migrate your database is via the c15t cli:

See Database Setup for adapter-specific migration guides.

Point your frontend at the backend

Update your frontend consent manager to use your self-hosted URL:

Verify it works

Open https://example.com/api/c15t/status in your browser. You should see a JSON response with the server version and your client info:

Info

The backend includes auto-generated API documentation. Visit {basePath}/docs (e.g. /api/c15t/docs) to explore all endpoints interactively.

Optional: Install Agent Skills

Install c15t agent skills to let AI agents help with styling, i18n, scripts & other configuration.

See AI Tools for details.

Next Steps