Quickstart

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 inth.com.

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. If you plan to use policy packs with runtime audit storage, also apply the runtime policy decision migration from the Policy Packs guide.

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: AI Agents

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

See AI Agents for bundled package docs and agent skills.

Next Steps