@c15t/backend 2.0.0-rc.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +3 -3
  2. package/dist/302.js +2 -3
  3. package/dist/{364.js → 915.js} +656 -25
  4. package/dist/core.cjs +497 -15
  5. package/dist/core.js +8 -156
  6. package/dist/db/schema.cjs +4 -0
  7. package/dist/db/schema.js +3 -2
  8. package/dist/edge.cjs +8 -8
  9. package/dist/edge.js +3 -3
  10. package/dist/router.cjs +253 -42
  11. package/dist/router.js +1 -1
  12. package/dist-types/cache/gvl-resolver.d.ts +1 -1
  13. package/dist-types/db/registry/consent-policy.d.ts +57 -1
  14. package/dist-types/db/registry/index.d.ts +43 -1
  15. package/dist-types/db/registry/types.d.ts +2 -1
  16. package/dist-types/db/schema/1.0.0/consent.d.ts +1 -1
  17. package/dist-types/db/schema/2.0.0/audit-log.d.ts +1 -1
  18. package/dist-types/db/schema/2.0.0/consent-policy.d.ts +3 -2
  19. package/dist-types/db/schema/2.0.0/consent-purpose.d.ts +1 -1
  20. package/dist-types/db/schema/2.0.0/consent.d.ts +1 -1
  21. package/dist-types/db/schema/2.0.0/domain.d.ts +1 -1
  22. package/dist-types/db/schema/2.0.0/index.d.ts +7 -0
  23. package/dist-types/db/schema/2.0.0/runtime-policy-decision.d.ts +1 -1
  24. package/dist-types/db/schema/2.0.0/subject.d.ts +1 -1
  25. package/dist-types/db/schema/index.d.ts +14 -0
  26. package/dist-types/edge/index.d.ts +2 -2
  27. package/dist-types/edge/init-handler.d.ts +5 -3
  28. package/dist-types/edge/resolve-consent.d.ts +6 -6
  29. package/dist-types/edge/types.d.ts +1 -1
  30. package/dist-types/handlers/init/index.d.ts +4 -4
  31. package/dist-types/handlers/init/policy.d.ts +1 -1
  32. package/dist-types/handlers/init/resolve-init.d.ts +2 -2
  33. package/dist-types/handlers/init/translations.d.ts +1 -1
  34. package/dist-types/handlers/legal-document/current.handler.d.ts +11 -0
  35. package/dist-types/handlers/legal-document/snapshot.d.ts +39 -0
  36. package/dist-types/handlers/subject/get.handler.d.ts +3 -0
  37. package/dist-types/handlers/subject/list.handler.d.ts +3 -0
  38. package/dist-types/handlers/utils/consent-enrichment.d.ts +3 -0
  39. package/dist-types/middleware/cors/is-origin-trusted.d.ts +1 -1
  40. package/dist-types/policies/builder.d.ts +7 -7
  41. package/dist-types/policies/defaults.d.ts +2 -2
  42. package/dist-types/policies/matchers.d.ts +2 -2
  43. package/dist-types/routes/index.d.ts +1 -0
  44. package/dist-types/routes/legal-document.d.ts +7 -0
  45. package/dist-types/types/index.d.ts +39 -18
  46. package/dist-types/utils/instrumentation.d.ts +2 -2
  47. package/dist-types/utils/logger.d.ts +1 -1
  48. package/dist-types/version.d.ts +1 -1
  49. package/docs/api/configuration.md +24 -13
  50. package/docs/guides/database-setup.md +4 -4
  51. package/docs/guides/edge-deployment.md +18 -15
  52. package/docs/guides/iab-tcf.md +4 -4
  53. package/docs/quickstart.md +9 -9
  54. package/package.json +8 -8
@@ -0,0 +1,7 @@
1
+ import { Hono } from 'hono';
2
+ import type { C15TContext } from '../types';
3
+ export declare const createLegalDocumentRoutes: () => Hono<{
4
+ Variables: {
5
+ c15tContext: C15TContext;
6
+ };
7
+ }, import("hono/types").BlankSchema, "/">;
@@ -1,19 +1,19 @@
1
- import type { createLogger, LoggerOptions } from '../../../logger/dist-types/index.d.ts';
2
- import { type Branding, type GlobalVendorList, type NonIABVendor, type PolicyConfig } from '../../../schema/dist-types/types';
3
- import type { Translations } from '../../../translations/dist-types/index.d.ts';
1
+ import type { createLogger, LoggerOptions } from '@c15t/logger';
2
+ import { type Branding, type GlobalVendorList, type NonIABVendor, type PolicyConfig } from '@c15t/schema/types';
3
+ import type { Translations } from '@c15t/translations';
4
4
  import type { Meter, Tracer } from '@opentelemetry/api';
5
5
  import type { FumaDB, InferFumaDB } from 'fumadb';
6
6
  import type { CacheAdapter } from '../cache/types';
7
7
  import type { createRegistry } from '../db/registry';
8
8
  import type { DB, LatestDB } from '../db/schema';
9
9
  export * from './api';
10
- export declare const branding: readonly ["c15t", "consent", "none"];
10
+ export declare const branding: readonly ["c15t", "inth", "consent", "none"];
11
11
  export type { Branding };
12
12
  export interface DatabaseOptions {
13
13
  /**
14
14
  * The database adapter to use.
15
15
  *
16
- * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
16
+ * @see {@link https://c15t.com/docs/self-host/guides/database-setup}
17
17
  */
18
18
  adapter: FumaDB<FumaDBSchema>['adapter'];
19
19
  /**
@@ -26,7 +26,7 @@ export interface DatabaseOptions {
26
26
  * Useful when sharing a database with other applications to avoid naming conflicts.
27
27
  *
28
28
  * @example 'c15t_' // tables become: c15t_subject, c15t_consent, etc.
29
- * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
29
+ * @see {@link https://c15t.com/docs/self-host/guides/database-setup}
30
30
  */
31
31
  tablePrefix?: string;
32
32
  }
@@ -244,7 +244,7 @@ export interface I18nOptions {
244
244
  */
245
245
  defaultProfile?: string;
246
246
  }
247
- export type { PolicyConfig, PolicyModel, PolicyPack, PolicyScopeMode, PolicyUiAction, PolicyUiActionDirection, PolicyUiActionGroup, PolicyUiMode, PolicyUiProfile, PolicyUiSurfaceConfig, } from '../../../schema/dist-types/types';
247
+ export type { LegalDocumentPolicyType, PolicyConfig, PolicyModel, PolicyPack, PolicyScopeMode, PolicyUiAction, PolicyUiActionDirection, PolicyUiActionGroup, PolicyUiMode, PolicyUiProfile, PolicyUiSurfaceConfig, } from '@c15t/schema/types';
248
248
  export interface PolicySnapshotOptions {
249
249
  /**
250
250
  * Secret used for signing and verifying policy snapshot tokens.
@@ -271,6 +271,22 @@ export interface PolicySnapshotOptions {
271
271
  */
272
272
  ttlSeconds?: number;
273
273
  }
274
+ export interface LegalDocumentSnapshotOptions {
275
+ /**
276
+ * Secret used for signing and verifying legal-document snapshot tokens.
277
+ */
278
+ signingKey: string;
279
+ /**
280
+ * JWT issuer claim for legal-document snapshot tokens.
281
+ * @default "c15t"
282
+ */
283
+ issuer?: string;
284
+ /**
285
+ * JWT audience claim for legal-document snapshot tokens.
286
+ * When omitted, c15t derives a default audience and scopes it per tenant.
287
+ */
288
+ audience?: string;
289
+ }
274
290
  export interface BackgroundOptions {
275
291
  /**
276
292
  * Executes non-critical tasks after the response path has completed.
@@ -281,7 +297,7 @@ export interface C15TOptions {
281
297
  /**
282
298
  * The database adapter to use.
283
299
  *
284
- * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
300
+ * @see {@link https://c15t.com/docs/self-host/guides/database-setup}
285
301
  */
286
302
  adapter: FumaDB<FumaDBSchema>['adapter'];
287
303
  /**
@@ -294,7 +310,7 @@ export interface C15TOptions {
294
310
  * Useful when sharing a database with other applications to avoid naming conflicts.
295
311
  *
296
312
  * @example 'c15t_' // tables become: c15t_subject, c15t_consent, etc.
297
- * @see {@link https://v2.c15t.com/docs/self-host/guides/database-setup}
313
+ * @see {@link https://c15t.com/docs/self-host/guides/database-setup}
298
314
  */
299
315
  tablePrefix?: string;
300
316
  /**
@@ -303,13 +319,13 @@ export interface C15TOptions {
303
319
  * and cache key prefixing.
304
320
  *
305
321
  * @default "c15t"
306
- * @see {@link https://v2.c15t.com/docs/self-host/api/configuration}
322
+ * @see {@link https://c15t.com/docs/self-host/api/configuration}
307
323
  */
308
324
  appName?: string;
309
325
  /**
310
326
  * Base path prefix for all API routes (e.g. `/api/self-host`).
311
327
  *
312
- * @see {@link https://v2.c15t.com/docs/self-host/api/endpoints}
328
+ * @see {@link https://c15t.com/docs/self-host/api/endpoints}
313
329
  */
314
330
  basePath?: string;
315
331
  /**
@@ -317,7 +333,7 @@ export interface C15TOptions {
317
333
  * Protocol is optional; matching is protocol-agnostic and normalized.
318
334
  *
319
335
  * @example ['example.com', 'app.example.com', 'localhost:3000']
320
- * @see {@link https://v2.c15t.com/docs/self-host/api/configuration}
336
+ * @see {@link https://c15t.com/docs/self-host/api/configuration}
321
337
  */
322
338
  trustedOrigins: string[];
323
339
  /** Logger configuration. */
@@ -357,11 +373,12 @@ export interface C15TOptions {
357
373
  * explicit no-banner mode. In production, prefer including a default policy
358
374
  * so unmatched traffic still resolves deterministically.
359
375
  *
360
- * @see {@link https://v2.c15t.com/docs/self-host/guides/policy-packs}
376
+ * @see {@link https://c15t.com/docs/self-host/guides/policy-packs}
361
377
  */
362
378
  policyPacks?: PolicyConfig[];
363
379
  /**
364
380
  * Select which branding to show in the consent banner.
381
+ * Use "inth" for the INTH brand. "consent" is a deprecated alias for "inth".
365
382
  * Use "none" to hide branding.
366
383
  * @default "c15t"
367
384
  */
@@ -369,7 +386,7 @@ export interface C15TOptions {
369
386
  /**
370
387
  * OpenAPI spec generation and documentation UI options.
371
388
  *
372
- * @see {@link https://v2.c15t.com/docs/self-host/api/endpoints}
389
+ * @see {@link https://c15t.com/docs/self-host/api/endpoints}
373
390
  */
374
391
  openapi?: OpenAPIOptions;
375
392
  /**
@@ -377,20 +394,20 @@ export interface C15TOptions {
377
394
  * Telemetry is opt-in and disabled by default.
378
395
  * Users must provide their own SDK setup (Node, Bun, edge, etc.).
379
396
  *
380
- * @see {@link https://v2.c15t.com/docs/self-host/guides/observability}
397
+ * @see {@link https://c15t.com/docs/self-host/guides/observability}
381
398
  */
382
399
  telemetry?: TelemetryOptions;
383
400
  /**
384
401
  * IP address tracking and masking options.
385
402
  *
386
- * @see {@link https://v2.c15t.com/docs/self-host/api/configuration}
403
+ * @see {@link https://c15t.com/docs/self-host/api/configuration}
387
404
  */
388
405
  ipAddress?: IPAddressOptions;
389
406
  /**
390
407
  * Cache configuration for external persistent storage.
391
408
  * Used for caching GVL and other data.
392
409
  *
393
- * @see {@link https://v2.c15t.com/docs/self-host/guides/caching}
410
+ * @see {@link https://c15t.com/docs/self-host/guides/caching}
394
411
  */
395
412
  cache?: CacheOptions;
396
413
  /**
@@ -408,13 +425,17 @@ export interface C15TOptions {
408
425
  * Disabled by default - most users don't need IAB TCF.
409
426
  * Set enabled: true to activate IAB support.
410
427
  *
411
- * @see {@link https://v2.c15t.com/docs/self-host/guides/iab-tcf}
428
+ * @see {@link https://c15t.com/docs/self-host/guides/iab-tcf}
412
429
  */
413
430
  iab?: IABOptions;
414
431
  /**
415
432
  * Optional signed policy snapshots used to keep /init and /subjects consistent.
416
433
  */
417
434
  policySnapshot?: PolicySnapshotOptions;
435
+ /**
436
+ * Optional signed legal-document snapshots issued by external document renderers.
437
+ */
438
+ legalDocumentSnapshot?: LegalDocumentSnapshotOptions;
418
439
  /**
419
440
  * Optional background task runner for non-critical side effects.
420
441
  */
@@ -3,8 +3,8 @@ import type { C15TOptions } from '../types';
3
3
  * Span attributes for database operations
4
4
  */
5
5
  export interface DatabaseSpanAttributes {
6
- /** The database operation type (find, create, update, delete) */
7
- operation: 'find' | 'create' | 'update' | 'delete' | 'findOrCreate';
6
+ /** The database operation type */
7
+ operation: 'find' | 'create' | 'update' | 'delete' | 'findOrCreate' | 'findLatest' | 'findByHash' | 'syncCurrent' | 'findOrCreateLegalDocument';
8
8
  /** The entity type being operated on */
9
9
  entity: string;
10
10
  /** Optional additional attributes */
@@ -1,4 +1,4 @@
1
- import { createLogger, type LoggerOptions } from '../../../logger/dist-types/index.d.ts';
1
+ import { createLogger, type LoggerOptions } from '@c15t/logger';
2
2
  /**
3
3
  * Gets or creates a global logger instance
4
4
  *
@@ -1 +1 @@
1
- export declare const version = "2.0.0-rc.6";
1
+ export declare const version = "2.0.0";
@@ -10,25 +10,26 @@ All options are passed to `c15tInstance()`. Only `adapter` and `trustedOrigins`
10
10
 
11
11
  |Property|Type|Description|Default|Required|
12
12
  |:--|:--|:--|:--|:--:|
13
- |adapter|[FumaDBAdapter](https://v2.c15t.com/docs/self-host/guides/database-setup)|The database adapter to use.|-|✅ Required|
13
+ |adapter|[FumaDBAdapter](https://c15t.com/docs/self-host/guides/database-setup)|The database adapter to use.|-|✅ Required|
14
14
  |tenantId|string \|undefined|Tenant ID for multi-tenant deployments. When set, all database queries are automatically scoped to this tenant.|-|Optional|
15
- |tablePrefix|[string \|undefined](https://v2.c15t.com/docs/self-host/guides/database-setup)|Optional prefix for all database table names. Useful when sharing a database with other applications to avoid naming conflicts.|-|Optional|
16
- |appName|[string \|undefined](https://v2.c15t.com/docs/self-host/api/configuration)|Application name used as backend metadata and identity. Returned by \`/init\` (\`appName\`), used in logs, telemetry defaults (\`service.name\`), and cache key prefixing.|"c15t"|Optional|
17
- |basePath|[string \|undefined](https://v2.c15t.com/docs/self-host/api/endpoints)|Base path prefix for all API routes (e.g. \`/api/self-host\`).|-|Optional|
18
- |trustedOrigins|[string\[\]](https://v2.c15t.com/docs/self-host/api/configuration)|Allowed origins for CORS. Required for browser-based consent collection. Protocol is optional; matching is protocol-agnostic and normalized.|-|✅ Required|
15
+ |tablePrefix|[string \|undefined](https://c15t.com/docs/self-host/guides/database-setup)|Optional prefix for all database table names. Useful when sharing a database with other applications to avoid naming conflicts.|-|Optional|
16
+ |appName|[string \|undefined](https://c15t.com/docs/self-host/api/configuration)|Application name used as backend metadata and identity. Returned by \`/init\` (\`appName\`), used in logs, telemetry defaults (\`service.name\`), and cache key prefixing.|"c15t"|Optional|
17
+ |basePath|[string \|undefined](https://c15t.com/docs/self-host/api/endpoints)|Base path prefix for all API routes (e.g. \`/api/self-host\`).|-|Optional|
18
+ |trustedOrigins|[string\[\]](https://c15t.com/docs/self-host/api/configuration)|Allowed origins for CORS. Required for browser-based consent collection. Protocol is optional; matching is protocol-agnostic and normalized.|-|✅ Required|
19
19
  |logger|LoggerOptions \|undefined|Logger configuration.|-|Optional|
20
20
  |disableGeoLocation|boolean \|undefined|Disables the use of Geo Location to determine the jurisdiction. When enabled, the jurisdiction will be set to "GDPR" to show the strictest version of the banner as we don't know the jurisdiction in this case.|false|Optional|
21
21
  |customTranslations|Record\<string, Partial\<Translations>> \|undefined|Override base translations.|-|Optional|
22
22
  |i18n|I18nOptions \|undefined|Internationalization message profiles used by runtime policies.|-|Optional|
23
- |policyPacks|[PolicyConfig \|undefined](https://v2.c15t.com/docs/self-host/guides/policy-packs)|Runtime regional policy pack resolved per request.|-|Optional|
24
- |branding|"c15t" \|"consent" \|"none" \|undefined|Select which branding to show in the consent banner. Use "none" to hide branding.|"c15t"|Optional|
25
- |openapi|[OpenAPIOptions \|undefined](https://v2.c15t.com/docs/self-host/api/endpoints)|OpenAPI spec generation and documentation UI options.|-|Optional|
26
- |telemetry|[TelemetryOptions \|undefined](https://v2.c15t.com/docs/self-host/guides/observability)|OpenTelemetry configuration for tracing and metrics. Telemetry is opt-in and disabled by default. Users must provide their own SDK setup (Node, Bun, edge, etc.).|-|Optional|
27
- |ipAddress|[IPAddressOptions \|undefined](https://v2.c15t.com/docs/self-host/api/configuration)|IP address tracking and masking options.|-|Optional|
28
- |cache|[CacheOptions \|undefined](https://v2.c15t.com/docs/self-host/guides/caching)|Cache configuration for external persistent storage. Used for caching GVL and other data.|-|Optional|
23
+ |policyPacks|[PolicyConfig \|undefined](https://c15t.com/docs/self-host/guides/policy-packs)|Runtime regional policy pack resolved per request.|-|Optional|
24
+ |branding|"c15t" \|"consent" \|"none" \|"inth" \|undefined|Select which branding to show in the consent banner. Use "inth" for the INTH brand. "consent" is a deprecated alias for "inth". Use "none" to hide branding.|"c15t"|Optional|
25
+ |openapi|[OpenAPIOptions \|undefined](https://c15t.com/docs/self-host/api/endpoints)|OpenAPI spec generation and documentation UI options.|-|Optional|
26
+ |telemetry|[TelemetryOptions \|undefined](https://c15t.com/docs/self-host/guides/observability)|OpenTelemetry configuration for tracing and metrics. Telemetry is opt-in and disabled by default. Users must provide their own SDK setup (Node, Bun, edge, etc.).|-|Optional|
27
+ |ipAddress|[IPAddressOptions \|undefined](https://c15t.com/docs/self-host/api/configuration)|IP address tracking and masking options.|-|Optional|
28
+ |cache|[CacheOptions \|undefined](https://c15t.com/docs/self-host/guides/caching)|Cache configuration for external persistent storage. Used for caching GVL and other data.|-|Optional|
29
29
  |apiKeys|string\[] \|undefined|API keys for authenticated endpoints. Used for server-side endpoints like GET /subjects.|-|Optional|
30
- |iab|[IABOptions \|undefined](https://v2.c15t.com/docs/self-host/guides/iab-tcf)|IAB TCF configuration including GVL, CMP registration, and custom vendors. Disabled by default - most users don't need IAB TCF. Set enabled: true to activate IAB support.|-|Optional|
30
+ |iab|[IABOptions \|undefined](https://c15t.com/docs/self-host/guides/iab-tcf)|IAB TCF configuration including GVL, CMP registration, and custom vendors. Disabled by default - most users don't need IAB TCF. Set enabled: true to activate IAB support.|-|Optional|
31
31
  |policySnapshot|PolicySnapshotOptions \|undefined|Optional signed policy snapshots used to keep /init and /subjects consistent.|-|Optional|
32
+ |legalDocumentSnapshot|LegalDocumentSnapshotOptions \|undefined|Optional signed legal-document snapshots issued by external document renderers.|-|Optional|
32
33
  |background|BackgroundOptions \|undefined|Optional background task runner for non-critical side effects.|-|Optional|
33
34
 
34
35
  #### `adapter` FumaDBAdapter
@@ -87,6 +88,16 @@ Optional signed policy snapshots used to keep /init and /subjects consistent.
87
88
  |audience|string \|undefined|JWT audience claim for snapshot tokens. When omitted, c15t derives a default snapshot audience and scopes it per tenant.|-|Optional|
88
89
  |ttlSeconds|number \|undefined|Snapshot token lifetime in seconds.|-|Optional|
89
90
 
91
+ #### `legalDocumentSnapshot` LegalDocumentSnapshotOptions
92
+
93
+ Optional signed legal-document snapshots issued by external document renderers.
94
+
95
+ |Property|Type|Description|Default|Required|
96
+ |:--|:--|:--|:--|:--:|
97
+ |signingKey|string|Secret used for signing and verifying legal-document snapshot tokens.|-|✅ Required|
98
+ |issuer|string \|undefined|JWT issuer claim for legal-document snapshot tokens.|-|Optional|
99
+ |audience|string \|undefined|JWT audience claim for legal-document snapshot tokens. When omitted, c15t derives a default audience and scopes it per tenant.|-|Optional|
100
+
90
101
  #### `background` BackgroundOptions
91
102
 
92
103
  Optional background task runner for non-critical side effects.
@@ -174,7 +185,7 @@ interface C15TInstance {
174
185
 
175
186
  ## Edge Init Options
176
187
 
177
- `c15tEdgeInit()` from `@c15t/backend/edge` accepts a subset of `C15TOptions` — only the fields needed for consent policy resolution without a database. See the [Edge Deployment guide](/docs/self-host/guides/edge-deployment) for usage.
188
+ `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.
178
189
 
179
190
  ### C15TEdgeOptions
180
191
 
@@ -95,10 +95,10 @@ To create & update the database you can use the migrator which is included in th
95
95
 
96
96
  |Package manager|Command|
97
97
  |:--|:--|
98
- |npm|`npx @c15t/cli@rc`|
99
- |pnpm|`pnpm dlx @c15t/cli@rc`|
100
- |yarn|`yarn dlx @c15t/cli@rc`|
101
- |bun|`bunx @c15t/cli@rc`|
98
+ |npm|`npx @c15t/cli`|
99
+ |pnpm|`pnpm dlx @c15t/cli`|
100
+ |yarn|`yarn dlx @c15t/cli`|
101
+ |bun|`bunx @c15t/cli`|
102
102
 
103
103
  ## Table Prefix
104
104
 
@@ -5,10 +5,13 @@ description: Run consent policy resolution at the edge for faster initial banner
5
5
  The `/init` endpoint determines consent policy from geo headers, resolves translations, and optionally fetches the GVL. None of this requires a database. The `@c15t/backend/edge` export lets you run this logic in edge runtimes (Vercel Middleware, Cloudflare Workers, Deno Deploy) so the consent banner resolves from the nearest PoP instead of round-tripping to your origin.
6
6
 
7
7
  ```
8
- Standard: Browser → Origin (single region) → c15tInstance(/init) → Response
9
- Edge: Browser → Edge (nearest PoP) → c15tEdgeInit → Response
8
+ Standard: Browser → Origin (single region) → c15tInstance(/init) → Response
9
+ Edge: Browser → Edge (nearest PoP) → unstable_c15tEdgeInit → Response
10
10
  ```
11
11
 
12
+ > ℹ️ **Info:**
13
+ > The edge runtime exports in @c15t/backend/edge are unstable in 2.0. Use the unstable\_-prefixed callables and expect API changes or removal in a future release.
14
+
12
15
  ## When to use this
13
16
 
14
17
  * Your origin server is in a single region and users are globally distributed
@@ -56,10 +59,10 @@ export const consentConfig = {
56
59
  **Vercel Middleware**
57
60
 
58
61
  ```ts title="middleware.ts"
59
- import { c15tEdgeInit } from '@c15t/backend/edge';
62
+ import { unstable_c15tEdgeInit } from '@c15t/backend/edge';
60
63
  import { consentConfig } from './lib/consent-config';
61
64
 
62
- const initHandler = c15tEdgeInit(consentConfig);
65
+ const initHandler = unstable_c15tEdgeInit(consentConfig);
63
66
 
64
67
  export async function middleware(request: Request) {
65
68
  const url = new URL(request.url);
@@ -76,10 +79,10 @@ export const config = {
76
79
  **Cloudflare Workers**
77
80
 
78
81
  ```ts title="worker.ts"
79
- import { c15tEdgeInit } from '@c15t/backend/edge';
82
+ import { unstable_c15tEdgeInit } from '@c15t/backend/edge';
80
83
  import { consentConfig } from './lib/consent-config';
81
84
 
82
- const initHandler = c15tEdgeInit(consentConfig);
85
+ const initHandler = unstable_c15tEdgeInit(consentConfig);
83
86
 
84
87
  export default {
85
88
  async fetch(request: Request) {
@@ -96,10 +99,10 @@ export default {
96
99
  **Deno Deploy**
97
100
 
98
101
  ```ts title="main.ts"
99
- import { c15tEdgeInit } from '@c15t/backend/edge';
102
+ import { unstable_c15tEdgeInit } from '@c15t/backend/edge';
100
103
  import { consentConfig } from './lib/consent-config.ts';
101
104
 
102
- const initHandler = c15tEdgeInit(consentConfig);
105
+ const initHandler = unstable_c15tEdgeInit(consentConfig);
103
106
 
104
107
  Deno.serve(async (request) => {
105
108
  const url = new URL(request.url);
@@ -128,7 +131,7 @@ export const { GET, POST } = c15t;
128
131
 
129
132
  ## Configuration
130
133
 
131
- `c15tEdgeInit` accepts `C15TEdgeOptions` — the same fields as `c15tInstance` minus the database-related options (`adapter`, `tablePrefix`, `basePath`, `openapi`, `ipAddress`, `apiKeys`, `background`).
134
+ `unstable_c15tEdgeInit` accepts `C15TEdgeOptions` — the same fields as `c15tInstance` minus the database-related options (`adapter`, `tablePrefix`, `basePath`, `openapi`, `ipAddress`, `apiKeys`, `background`).
132
135
 
133
136
  |Option|Required|Description|
134
137
  |--|--|--|
@@ -168,15 +171,15 @@ Edge isolates have short-lived memory. The in-memory GVL cache resets on each co
168
171
  * **Bundle GVL translations** using `iab.bundled` to avoid fetch latency entirely
169
172
  * **Use an external cache** (Upstash Redis, Cloudflare KV) via the `cache.adapter` option to share cached data across isolates — see the [Caching guide](/docs/self-host/guides/caching) for setup
170
173
 
171
- ## Custom consent cookie — resolveConsent
174
+ ## Custom consent cookie — unstable\_resolveConsent
172
175
 
173
176
  > ℹ️ **Info:**
174
177
  > Experimental — this API may change in future versions.
175
178
 
176
- If you manage your own consent cookie and just need to know **which categories to load** for a given visitor, use `resolveConsent` instead of `c15tEdgeInit`. It's a lightweight, fully synchronous function that returns the matched policy and default consent state — no translations, GVL, branding, or snapshot tokens.
179
+ If you manage your own consent cookie and just need to know **which categories to load** for a given visitor, use `unstable_resolveConsent` instead of `unstable_c15tEdgeInit`. It's a lightweight, fully synchronous function that returns the matched policy and default consent state — no translations, GVL, branding, or snapshot tokens.
177
180
 
178
181
  ```ts title="middleware.ts"
179
- import { resolveConsent } from '@c15t/backend/edge';
182
+ import { unstable_resolveConsent } from '@c15t/backend/edge';
180
183
 
181
184
  const policyPacks = [
182
185
  {
@@ -201,7 +204,7 @@ const policyPacks = [
201
204
  ];
202
205
 
203
206
  export function middleware(request: Request) {
204
- const consent = resolveConsent(request, { policyPacks });
207
+ const consent = unstable_resolveConsent(request, { policyPacks });
205
208
 
206
209
  // consent.model → "opt-in" | "opt-out" | "none" | "iab"
207
210
  // consent.showBanner → true
@@ -226,9 +229,9 @@ export function middleware(request: Request) {
226
229
  |`opt-out`|granted, required|**granted**|GPC signal can override `marketing`/`measurement` to not granted|
227
230
  |`none`|granted, required|**granted**|No banner shown|
228
231
 
229
- ### `resolveConsent` vs `c15tEdgeInit`
232
+ ### `unstable_resolveConsent` vs `unstable_c15tEdgeInit`
230
233
 
231
- ||`resolveConsent`|`c15tEdgeInit`|
234
+ ||`unstable_resolveConsent`|`unstable_c15tEdgeInit`|
232
235
  |--|--|--|
233
236
  |**Use case**|Custom consent cookie|Drop-in `/init` replacement|
234
237
  |**Sync**|Yes|No (async — signs JWT, fetches GVL)|
@@ -6,7 +6,7 @@ The c15t backend optionally supports [IAB TCF v2.3](https://iabeurope.eu/transpa
6
6
 
7
7
  ## CMP Registration
8
8
 
9
- [consent.io](https://consent.io) is pending validation as an IAB Europe-registered CMP for c15t. Once approved, when using consent.io as your hosted backend, the CMP ID will be automatically provided to clients — no additional configuration needed.
9
+ [inth.com](https://inth.com) is pending validation as an IAB Europe-registered CMP for c15t. Once approved, when using inth.com as your hosted backend, the CMP ID will be automatically provided to clients — no additional configuration needed.
10
10
 
11
11
  If you self-host and have your own CMP registration with IAB Europe, configure your CMP ID via `iab.cmpId`. This value is returned to clients in the `/init` response so they use the correct CMP identity in TC Strings.
12
12
 
@@ -14,7 +14,7 @@ If you self-host and have your own CMP registration with IAB Europe, configure y
14
14
  > A valid (non-zero) CMP ID is required for IAB TCF compliance. If neither the backend nor the client provides a CMP ID, IAB initialization will fail with an error.
15
15
  >
16
16
  > ℹ️ **Info:**
17
- > If you heavily customize or build your own IAB banner or dialog (rather than using the default IABConsentBanner and IABConsentDialog components provided by c15t), you cannot use consent.io's CMP ID. You must register your own CMP with IAB Europe and configure your CMP ID via iab.cmpId.
17
+ > If you heavily customize or build your own IAB banner or dialog (rather than using the default IABConsentBanner and IABConsentDialog components provided by c15t), you cannot use inth.com's CMP ID. You must register your own CMP with IAB Europe and configure your CMP ID via iab.cmpId.
18
18
 
19
19
  ## Enable IAB
20
20
 
@@ -25,13 +25,13 @@ export const c15t = c15tInstance({
25
25
  // ...
26
26
  iab: {
27
27
  enabled: true,
28
- cmpId: 10, // your registered CMP ID (consent.io provides this automatically)
28
+ cmpId: 10, // your registered CMP ID (inth.com provides this automatically)
29
29
  vendorIds: [755, 52, 69], // only include vendors you use
30
30
  },
31
31
  });
32
32
  ```
33
33
 
34
- The backend fetches the GVL from `https://gvl.consent.io` by default and caches it. The `/init` endpoint returns the filtered GVL and your CMP ID to the frontend.
34
+ The backend fetches the GVL from `https://gvl.inth.com` by default and caches it. The `/init` endpoint returns the filtered GVL and your CMP ID to the frontend.
35
35
 
36
36
  ## Custom GVL Endpoint
37
37
 
@@ -6,7 +6,7 @@ The `@c15t/backend` package gives you a fully self-hosted consent management API
6
6
 
7
7
  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.
8
8
 
9
- If you want a fully managed experience we recommend using [consent.io](https://consent.io).
9
+ If you want a fully managed experience we recommend using [inth.com](https://inth.com).
10
10
 
11
11
  ## Installation
12
12
 
@@ -76,10 +76,10 @@ If you want a fully managed experience we recommend using [consent.io](https://c
76
76
 
77
77
  |Package manager|Command|
78
78
  |:--|:--|
79
- |npm|`npx @c15t/cli@rc`|
80
- |pnpm|`pnpm dlx @c15t/cli@rc`|
81
- |yarn|`yarn dlx @c15t/cli@rc`|
82
- |bun|`bunx @c15t/cli@rc`|
79
+ |npm|`npx @c15t/cli`|
80
+ |pnpm|`pnpm dlx @c15t/cli`|
81
+ |yarn|`yarn dlx @c15t/cli`|
82
+ |bun|`bunx @c15t/cli`|
83
83
 
84
84
  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.
85
85
 
@@ -119,10 +119,10 @@ Install c15t agent skills to let AI agents help with styling, i18n, scripts & ot
119
119
 
120
120
  |Package manager|Command|
121
121
  |:--|:--|
122
- |npm|`npx @c15t/cli@rc skills`|
123
- |pnpm|`pnpm dlx @c15t/cli@rc skills`|
124
- |yarn|`yarn dlx @c15t/cli@rc skills`|
125
- |bun|`bunx @c15t/cli@rc skills`|
122
+ |npm|`npx @c15t/cli skills`|
123
+ |pnpm|`pnpm dlx @c15t/cli skills`|
124
+ |yarn|`yarn dlx @c15t/cli skills`|
125
+ |bun|`bunx @c15t/cli skills`|
126
126
 
127
127
  See [AI Agents](/docs/ai-agents) for bundled package docs and agent skills.
128
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c15t/backend",
3
- "version": "2.0.0-rc.6",
3
+ "version": "2.0.0",
4
4
  "description": "Consent policy engine and API for c15t. Powers the cookie banner, consent manager, and preferences centre. Webhooks, audit logs, storage adapters. Self host or use consent.io",
5
5
  "keywords": [
6
6
  "consent",
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/c15t/c15t.git",
26
26
  "directory": "packages/backend"
27
27
  },
28
- "license": "GPL-3.0-only",
28
+ "license": "Apache-2.0",
29
29
  "type": "module",
30
30
  "exports": {
31
31
  ".": {
@@ -110,10 +110,10 @@
110
110
  ],
111
111
  "scripts": {
112
112
  "prebuild": "genversion --esm --semi src/version.ts",
113
- "build": "bun prebuild && rslib build && bun ../../scripts/agent-docs/generate-package-docs.ts @c15t/backend",
113
+ "build": "bun prebuild && rslib build && bun ../../scripts/normalize-dist-types.mjs && bun ../../scripts/agent-docs/generate-package-docs.ts @c15t/backend",
114
114
  "build:agent-docs": "bun ../../scripts/agent-docs/generate-package-docs.ts @c15t/backend",
115
115
  "check-types": "bun prebuild && tsc --noEmit",
116
- "dev": "bun prebuild && rslib build",
116
+ "dev": "bun prebuild && rslib build && bun ../../scripts/normalize-dist-types.mjs",
117
117
  "fmt": "bun biome format --write . && bun biome check --formatter-enabled=false --linter-enabled=false --write",
118
118
  "knip": "knip",
119
119
  "lint": "bun biome lint ./src",
@@ -123,9 +123,9 @@
123
123
  "test:watch": "bun prebuild && vitest"
124
124
  },
125
125
  "dependencies": {
126
- "@c15t/logger": "1.0.2-rc.0",
127
- "@c15t/schema": "2.0.0-rc.4",
128
- "@c15t/translations": "2.0.0-rc.5",
126
+ "@c15t/logger": "2.0.0",
127
+ "@c15t/schema": "2.0.0",
128
+ "@c15t/translations": "2.0.0",
129
129
  "@hono/standard-validator": "^0.2.2",
130
130
  "@hono/valibot-validator": "0.6.1",
131
131
  "@opentelemetry/api": "1.9.1",
@@ -141,7 +141,7 @@
141
141
  "valibot": "1.3.1"
142
142
  },
143
143
  "devDependencies": {
144
- "@c15t/typescript-config": "0.0.1-beta.1",
144
+ "@c15t/typescript-config": "0.0.1",
145
145
  "@c15t/vitest-config": "1.0.0",
146
146
  "@opentelemetry/sdk-trace-base": "^2.6.1",
147
147
  "@types/node": "25.5.0",