API Reference

Configuration Reference

All options are passed to c15tInstance(). Only adapter and trustedOrigins are required.

Options

Warning: ExtractedTypeTable: Could not extract "C15TOptions" from "./packages/backend/src/types/index.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.

Loading…

Warning: ExtractedTypeTable: Could not extract "OpenAPIOptions" from "./packages/backend/src/types/index.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.

Loading…

Warning: ExtractedTypeTable: Could not extract "TelemetryOptions" from "./packages/backend/src/types/index.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.

Loading…

Warning: ExtractedTypeTable: Could not extract "IPAddressOptions" from "./packages/backend/src/types/index.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.

Loading…

Warning: ExtractedTypeTable: Could not extract "CacheOptions" from "./packages/backend/src/types/index.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.

Loading…

Warning: ExtractedTypeTable: Could not extract "IABOptions" from "./packages/backend/src/types/index.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.

Loading…

Return Value

c15tInstance() returns:

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 for usage.

Warning: ExtractedTypeTable: Could not extract "C15TEdgeOptions" from "./packages/backend/src/edge/types.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.

Loading…

defineConfig Helper

For type-safe configuration in a separate file:

c15t.config.ts
import { defineConfig } from '@c15t/backend';

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