Database Setup

Configure a database adapter for your self-hosted c15t backend.

The c15t backend requires a database to store consent records, subjects, audit logs, and policies. Five adapters are supported — choose the one that matches your existing stack.

Adapters

Kysely

Drizzle

Prisma

TypeORM

MongoDB

Migrations

To create & update the database you can use the migrator which is included in the CLI:

Table Prefix

If you share a database with other applications, use tablePrefix to namespace the c15t tables:

This prefixes all table names (e.g. c15t_subject, c15t_consent, c15t_audit_log).

Schema Overview

The backend creates and manages these tables:

TablePurpose
subjectConsent subjects (users/devices). Tracks identification status and external IDs.
consentAppend-only consent records. Stores preferences, jurisdiction, IP, and timestamps.
domainDomain/website configuration for multi-domain setups.
consent_policyVersioned consent policies.
consent_purposeMaps consent purposes to categories.
audit_logImmutable log of all consent-related actions.