---
title: Configuration Reference
description: Complete reference for all c15t backend configuration options.
---
All options are passed to `c15tInstance()`. Only `adapter` and `trustedOrigins` are required.

## Options

| Property              | Type                                       | Description                                                                                                                                                                                                                   | Default |  Required  |
| :-------------------- | :----------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ | :--------: |
| adapter               | FumaDB\<InferFumaDB\<any>>                 | The database adapter to use.                                                                                                                                                                                                  | -       | ✅ Required |
| tenantId              | string \| undefined                        | Tenant ID for multi-tenant deployments.&#xA;When set, all database queries are automatically scoped to this tenant.                                                                                                           | -       |  Optional  |
| tablePrefix           | string \| undefined                        | Optional prefix for all database table names.&#xA;Useful when sharing a database with other applications to avoid naming conflicts.                                                                                           | -       |  Optional  |
| appName               | string \| undefined                        | Application name used as backend metadata and identity.&#xA;Returned by \`/init\` (\`appName\`), used in logs, telemetry defaults (\`service.name\`),&#xA;and cache key prefixing.                                            | "c15t"  |  Optional  |
| basePath              | string \| undefined                        | Base path prefix for all API routes (e.g. \`/api/self-host\`).                                                                                                                                                                | -       |  Optional  |
| trustedOrigins        | string\[]                                  | Allowed origins for CORS. Required for browser-based consent collection.&#xA;Protocol is optional; matching is protocol-agnostic and normalized.                                                                              | -       | ✅ Required |
| logger                | any                                        | Logger configuration.                                                                                                                                                                                                         | -       |  Optional  |
| disableGeoLocation    | boolean \| undefined                       | Disables the use of Geo Location to determine the jurisdiction.&#xA;&#xA;When enabled, the jurisdiction will be set to "GDPR" to show the strictest&#xA;version of the banner as we don't know the jurisdiction in this case. | false   |  Optional  |
| customTranslations    | Record\<string, Translations> \| undefined | Override base translations.                                                                                                                                                                                                   | -       |  Optional  |
| i18n                  | I18nOptions \| undefined                   | Internationalization message profiles used by runtime policies.                                                                                                                                                               | -       |  Optional  |
| policyPacks           | PolicyConfig\[] \| undefined               | Runtime regional policy pack resolved per request.                                                                                                                                                                            | -       |  Optional  |
| branding              | any                                        | Select which branding to show in the consent banner.&#xA;Use "inth" for the INTH brand. "consent" is a deprecated alias for "inth".&#xA;Use "none" to hide branding.                                                          | "c15t"  |  Optional  |
| openapi               | OpenAPIOptions \| undefined                | OpenAPI spec generation and documentation UI options.                                                                                                                                                                         | -       |  Optional  |
| telemetry             | TelemetryOptions \| undefined              | OpenTelemetry configuration for tracing and metrics.&#xA;Telemetry is opt-in and disabled by default.&#xA;Users must provide their own SDK setup (Node, Bun, edge, etc.).                                                     | -       |  Optional  |
| ipAddress             | IPAddressOptions \| undefined              | IP address tracking and masking options.                                                                                                                                                                                      | -       |  Optional  |
| cache                 | CacheOptions \| undefined                  | Cache configuration for external persistent storage.&#xA;Used for caching GVL and other data.                                                                                                                                 | -       |  Optional  |
| apiKeys               | string\[] \| undefined                     | API keys for authenticated endpoints.&#xA;Used for server-side endpoints like GET /subjects.                                                                                                                                  | -       |  Optional  |
| iab                   | IABOptions \| undefined                    | IAB TCF configuration including GVL, CMP registration, and custom vendors.&#xA;Disabled by default - most users don't need IAB TCF.&#xA;Set enabled: true to activate IAB support.                                            | -       |  Optional  |
| policySnapshot        | PolicySnapshotOptions \| undefined         | Optional signed policy snapshots used to keep /init and /subjects consistent.                                                                                                                                                 | -       |  Optional  |
| legalDocumentSnapshot | LegalDocumentSnapshotOptions \| undefined  | Optional signed legal-document snapshots issued by external document renderers.                                                                                                                                               | -       |  Optional  |
| background            | BackgroundOptions \| undefined             | Optional background task runner for non-critical side effects.                                                                                                                                                                | -       |  Optional  |

| Property         | Type                                                                                                                                                                                                                                                                              | Description                                                                                                                | Default      | Required |
| :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------- | :----------- | :------: |
| enabled          | boolean \| undefined                                                                                                                                                                                                                                                              | Enable/disable OpenAPI spec generation                                                                                     | true         | Optional |
| specPath         | string \| undefined                                                                                                                                                                                                                                                               | Path to serve the OpenAPI JSON spec                                                                                        | "/spec.json" | Optional |
| docsPath         | string \| undefined                                                                                                                                                                                                                                                               | Path to serve the API documentation UI                                                                                     | "/docs"      | Optional |
| options          | \{ info?: \{ title?: string \| undefined; version?: string \| undefined; description?: string \| undefined; } \| undefined; servers?: \{ url: string; description?: string \| undefined; }\[] \| undefined; security?: Record\<string, string\[]>\[] \| undefined; } \| undefined | OpenAPI specification options                                                                                              | -            | Optional |
| customUiTemplate | string \| undefined                                                                                                                                                                                                                                                               | Custom template for rendering the API documentation UI&#xA;If provided, this will be used instead of the default Scalar UI | -            | Optional |

| Property          | Type                                                      | Description                                                                                                            | Default | Required |
| :---------------- | :-------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------- | :------ | :------: |
| enabled           | boolean \| undefined                                      | Enable telemetry (tracing and metrics).&#xA;Must be explicitly set to true to activate.                                | false   | Optional |
| tracer            | any                                                       | User-provided tracer instance.&#xA;Users should set up their own OpenTelemetry SDK and pass the tracer here.           | -       | Optional |
| meter             | any                                                       | User-provided meter instance for metrics.&#xA;Users should set up their own OpenTelemetry SDK and pass the meter here. | -       | Optional |
| defaultAttributes | Record\<string, string \| number \| boolean> \| undefined | Default attributes to include on all spans and metrics.                                                                | -       | Optional |

| Property         | Type                   | Description                                                                                                                                                                                                                | Default | Required |
| :--------------- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ | :------: |
| tracking         | boolean \| undefined   | Enable/disable IP address tracking.&#xA;When disabled, all IP addresses will be stored as null.                                                                                                                            | true    | Optional |
| masking          | boolean \| undefined   | Enable/disable IP address masking to reduce PII collection.&#xA;- IPv4: Last octet is replaced with 0 (e.g., 192.168.1.100 -> 192.168.1.0)&#xA;- IPv6: Last 80 bits are masked (e.g., 2001:db8:85a3::1 -> 2001:db8:85a3::) | true    | Optional |
| ipAddressHeaders | string\[] \| undefined | Override the default IP address headers used to extract client IP.&#xA;Headers are checked in order, first match wins.                                                                                                     | -       | Optional |

| Property | Type                      | Description                                                                                  | Default | Required |
| :------- | :------------------------ | :------------------------------------------------------------------------------------------- | :------ | :------: |
| adapter  | CacheAdapter \| undefined | External cache adapter (Redis, KV, etc.).&#xA;If not provided, only in-memory cache is used. | -       | Optional |

| Property      | Type                                           | Description                                                                                                                                                                                                                                    | Default                   |  Required  |
| :------------ | :--------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------ | :--------: |
| enabled       | true                                           | Enable IAB TCF support.&#xA;When false or not provided, /init does not include IAB payload fields.&#xA;When true, /init includes IAB payload only when IAB is active for the&#xA;resolved request policy (or when no policies are configured). | -                         | ✅ Required |
| cmpId         | number \| undefined                            | CMP ID registered with IAB Europe.&#xA;This is returned to clients via the /init endpoint so they&#xA;can use the correct CMP identity in TC Strings.                                                                                          | -                         |  Optional  |
| bundled       | Record\<string, GlobalVendorList> \| undefined | Bundled GVL translations by language code.&#xA;These are checked first before any cache or fetch.                                                                                                                                              | -                         |  Optional  |
| vendorIds     | number\[] \| undefined                         | Vendor IDs to filter when fetching non-bundled languages.&#xA;Reduces payload size.                                                                                                                                                            | -                         |  Optional  |
| endpoint      | string \| undefined                            | Override the default GVL endpoint.                                                                                                                                                                                                             | 'https\://gvl.consent.io' |  Optional  |
| customVendors | NonIABVendor\[] \| undefined                   | Custom vendors not registered with IAB.&#xA;These are synced to the frontend via the /init endpoint.                                                                                                                                           | -                         |  Optional  |

## Return Value

`c15tInstance()` returns:

```ts
interface C15TInstance {
  /** Standard Fetch API handler */
  handler: (request: Request) => Promise<Response>;

  /** Resolved configuration */
  options: C15TOptions;

  /** Internal context (database, registry, logger) */
  $context: C15TContext;

  /** OpenAPI spec as JSON */
  getOpenAPISpec: () => Promise<Record<string, unknown>>;

  /** OpenAPI docs UI as HTML string */
  getDocsUI: () => string;
}
```

## Edge Init Options

`unstable_c15tEdgeInit()` from `@c15t/backend/edge` accepts a subset of `C15TOptions` — only the fields needed for consent policy resolution without a database. This edge runtime API is unstable in `2.0`. See the [Edge Deployment guide](/docs/self-host/guides/edge-deployment) for usage.

| Property        | Type            | Description                    | Default |  Required  |
| :-------------- | :-------------- | :----------------------------- | :------ | :--------: |
| C15TEdgeOptions | C15TEdgeOptions | Type alias for C15TEdgeOptions | -       | ✅ Required |

## defineConfig Helper

For type-safe configuration in a separate file:

```ts title="c15t.config.ts"
import { defineConfig } from '@c15t/backend';

export default defineConfig({
  adapter: kyselyAdapter(db),
  trustedOrigins: ['https://example.com'],
  // full autocomplete on all options here
});
```
