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:
| Table | Purpose |
|---|---|
subject | Consent subjects (users/devices). Tracks identification status and external IDs. |
consent | Append-only consent records. Stores preferences, jurisdiction, IP, and timestamps. |
domain | Domain/website configuration for multi-domain setups. |
consent_policy | Versioned consent policies. |
consent_purpose | Maps consent purposes to categories. |
audit_log | Immutable log of all consent-related actions. |