@c15t/backend 2.0.0-rc.5 → 2.0.0-rc.8

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 (69) hide show
  1. package/dist/302.js +473 -0
  2. package/dist/583.js +540 -0
  3. package/dist/915.js +1742 -0
  4. package/dist/cache.cjs +1 -1
  5. package/dist/cache.js +4 -415
  6. package/dist/core.cjs +484 -33
  7. package/dist/core.js +21 -2571
  8. package/dist/db/adapters/drizzle.cjs +1 -1
  9. package/dist/db/adapters/drizzle.js +1 -2
  10. package/dist/db/adapters/kysely.cjs +1 -1
  11. package/dist/db/adapters/kysely.js +1 -2
  12. package/dist/db/adapters/mongo.cjs +1 -1
  13. package/dist/db/adapters/mongo.js +1 -2
  14. package/dist/db/adapters/prisma.cjs +1 -1
  15. package/dist/db/adapters/prisma.js +1 -2
  16. package/dist/db/adapters/typeorm.cjs +1 -1
  17. package/dist/db/adapters/typeorm.js +1 -2
  18. package/dist/db/adapters.cjs +1 -1
  19. package/dist/db/migrator.cjs +1 -1
  20. package/dist/db/schema.cjs +5 -1
  21. package/dist/db/schema.js +3 -2
  22. package/dist/define-config.cjs +1 -1
  23. package/dist/edge.cjs +9 -9
  24. package/dist/edge.js +6 -885
  25. package/dist/router.cjs +239 -57
  26. package/dist/router.js +1 -2058
  27. package/dist/types/index.cjs +1 -1
  28. package/dist-types/cache/gvl-resolver.d.ts +1 -1
  29. package/dist-types/db/registry/consent-policy.d.ts +57 -1
  30. package/dist-types/db/registry/index.d.ts +43 -1
  31. package/dist-types/db/registry/runtime-policy-decision.d.ts +1 -1
  32. package/dist-types/db/registry/types.d.ts +2 -1
  33. package/dist-types/db/schema/1.0.0/consent.d.ts +2 -2
  34. package/dist-types/db/schema/2.0.0/audit-log.d.ts +2 -2
  35. package/dist-types/db/schema/2.0.0/consent-policy.d.ts +3 -2
  36. package/dist-types/db/schema/2.0.0/consent-purpose.d.ts +2 -2
  37. package/dist-types/db/schema/2.0.0/consent.d.ts +2 -2
  38. package/dist-types/db/schema/2.0.0/domain.d.ts +2 -2
  39. package/dist-types/db/schema/2.0.0/index.d.ts +7 -0
  40. package/dist-types/db/schema/2.0.0/runtime-policy-decision.d.ts +2 -2
  41. package/dist-types/db/schema/2.0.0/subject.d.ts +2 -2
  42. package/dist-types/db/schema/index.d.ts +14 -0
  43. package/dist-types/edge/index.d.ts +2 -2
  44. package/dist-types/edge/init-handler.d.ts +5 -3
  45. package/dist-types/edge/resolve-consent.d.ts +6 -6
  46. package/dist-types/edge/types.d.ts +1 -1
  47. package/dist-types/handlers/init/index.d.ts +4 -4
  48. package/dist-types/handlers/init/policy.d.ts +1 -1
  49. package/dist-types/handlers/init/resolve-init.d.ts +2 -2
  50. package/dist-types/handlers/init/translations.d.ts +1 -1
  51. package/dist-types/handlers/legal-document/current.handler.d.ts +11 -0
  52. package/dist-types/handlers/legal-document/snapshot.d.ts +39 -0
  53. package/dist-types/handlers/policy/snapshot.d.ts +1 -1
  54. package/dist-types/handlers/subject/get.handler.d.ts +3 -0
  55. package/dist-types/handlers/subject/list.handler.d.ts +3 -0
  56. package/dist-types/handlers/utils/consent-enrichment.d.ts +3 -0
  57. package/dist-types/middleware/cors/is-origin-trusted.d.ts +1 -1
  58. package/dist-types/policies/defaults.d.ts +2 -2
  59. package/dist-types/policies/matchers.d.ts +2 -2
  60. package/dist-types/routes/index.d.ts +1 -0
  61. package/dist-types/routes/legal-document.d.ts +7 -0
  62. package/dist-types/types/index.d.ts +26 -5
  63. package/dist-types/utils/instrumentation.d.ts +2 -2
  64. package/dist-types/utils/logger.d.ts +1 -1
  65. package/dist-types/version.d.ts +1 -1
  66. package/docs/api/configuration.md +13 -2
  67. package/docs/guides/edge-deployment.md +18 -15
  68. package/docs/guides/policy-packs.md +1 -1
  69. package/package.json +19 -19
@@ -0,0 +1,39 @@
1
+ import { type JWTPayload } from 'jose';
2
+ import type { LegalDocumentPolicyType, LegalDocumentSnapshotOptions } from '../../types';
3
+ export type LegalDocumentSnapshotVerificationFailureReason = 'missing' | 'malformed' | 'expired' | 'invalid';
4
+ export type LegalDocumentSnapshotVerificationResult = {
5
+ valid: true;
6
+ payload: LegalDocumentSnapshotPayload;
7
+ } | {
8
+ valid: false;
9
+ reason: LegalDocumentSnapshotVerificationFailureReason;
10
+ };
11
+ export interface LegalDocumentSnapshotPayload extends JWTPayload {
12
+ iss: string;
13
+ aud: string;
14
+ sub: string;
15
+ tenantId?: string;
16
+ type: LegalDocumentPolicyType;
17
+ version: string;
18
+ hash: string;
19
+ effectiveDate: string;
20
+ iat: number;
21
+ exp: number;
22
+ }
23
+ export declare function createLegalDocumentSnapshotToken(params: {
24
+ options?: LegalDocumentSnapshotOptions;
25
+ tenantId?: string;
26
+ type: LegalDocumentPolicyType;
27
+ version: string;
28
+ hash: string;
29
+ effectiveDate: string;
30
+ ttlSeconds?: number;
31
+ }): Promise<{
32
+ token: string;
33
+ payload: LegalDocumentSnapshotPayload;
34
+ } | undefined>;
35
+ export declare function verifyLegalDocumentSnapshotToken(params: {
36
+ token?: string;
37
+ options?: LegalDocumentSnapshotOptions;
38
+ tenantId?: string;
39
+ }): Promise<LegalDocumentSnapshotVerificationResult>;
@@ -11,7 +11,7 @@ export type PolicySnapshotVerificationResult = {
11
11
  };
12
12
  export interface PolicySnapshotUiSurface {
13
13
  allowedActions?: PolicyUiSurfaceConfig['allowedActions'];
14
- primaryAction?: PolicyUiSurfaceConfig['primaryAction'];
14
+ primaryActions?: PolicyUiSurfaceConfig['primaryActions'];
15
15
  layout?: PolicyUiSurfaceConfig['layout'];
16
16
  direction?: PolicyUiSurfaceConfig['direction'];
17
17
  uiProfile?: PolicyUiSurfaceConfig['uiProfile'];
@@ -20,6 +20,9 @@ export declare const getSubjectHandler: (c: Context) => Promise<Response & impor
20
20
  id: string;
21
21
  type: string;
22
22
  policyId: string | undefined;
23
+ policyVersion: string | undefined;
24
+ policyHash: string | undefined;
25
+ policyEffectiveDate: string | undefined;
23
26
  isLatestPolicy: boolean;
24
27
  preferences: {
25
28
  [x: string]: boolean;
@@ -19,6 +19,9 @@ export declare const listSubjectsHandler: (c: Context) => Promise<Response & imp
19
19
  id: string;
20
20
  type: string;
21
21
  policyId: string | undefined;
22
+ policyVersion: string | undefined;
23
+ policyHash: string | undefined;
24
+ policyEffectiveDate: string | undefined;
22
25
  isLatestPolicy: boolean;
23
26
  preferences: {
24
27
  [x: string]: boolean;
@@ -12,6 +12,9 @@ export interface EnrichedConsentItem {
12
12
  id: string;
13
13
  type: string;
14
14
  policyId: string | undefined;
15
+ policyVersion: string | undefined;
16
+ policyHash: string | undefined;
17
+ policyEffectiveDate: Date | undefined;
15
18
  isLatestPolicy: boolean;
16
19
  preferences: Record<string, boolean> | undefined;
17
20
  givenAt: Date;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import type { Logger } from '../../../../logger/dist-types/index.d.ts';
6
+ import type { Logger } from '@c15t/logger';
7
7
  /**
8
8
  * Regular expression to strip protocol, trailing slashes, and port numbers from URLs
9
9
  * Matches:
@@ -1,2 +1,2 @@
1
- export { policyPackPresets } from '../../../schema/dist-types/index.d.ts';
2
- export type { EuropePolicyMode, PolicyPackPresets } from '../../../schema/dist-types/types.d';
1
+ export { policyPackPresets } from '@c15t/schema';
2
+ export type { EuropePolicyMode, PolicyPackPresets } from '@c15t/schema/types';
@@ -1,3 +1,3 @@
1
- import type { PolicyMatch } from '../../../schema/dist-types/types.d';
2
- export { EEA_COUNTRY_CODES, EU_COUNTRY_CODES, POLICY_MATCH_DATASET_VERSION, policyMatchers, UK_COUNTRY_CODES, } from '../../../schema/dist-types/types.d';
1
+ import type { PolicyMatch } from '@c15t/schema/types';
2
+ export { EEA_COUNTRY_CODES, EU_COUNTRY_CODES, POLICY_MATCH_DATASET_VERSION, policyMatchers, UK_COUNTRY_CODES, } from '@c15t/schema/types';
3
3
  export type { PolicyMatch };
@@ -5,5 +5,6 @@
5
5
  */
6
6
  export { createConsentRoutes } from './consent';
7
7
  export { createInitRoute } from './init';
8
+ export { createLegalDocumentRoutes } from './legal-document';
8
9
  export { createStatusRoute } from './status';
9
10
  export { createSubjectRoutes } from './subject';
@@ -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,13 +1,13 @@
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.d';
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
  /**
@@ -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.d';
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.
@@ -362,6 +378,7 @@ export interface C15TOptions {
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
  */
@@ -415,6 +432,10 @@ export interface C15TOptions {
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.5";
1
+ export declare const version = "2.0.0-rc.8";
@@ -21,7 +21,7 @@ All options are passed to `c15tInstance()`. Only `adapter` and `trustedOrigins`
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
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|
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
25
  |openapi|[OpenAPIOptions \|undefined](https://v2.c15t.com/docs/self-host/api/endpoints)|OpenAPI spec generation and documentation UI options.|-|Optional|
26
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
27
  |ipAddress|[IPAddressOptions \|undefined](https://v2.c15t.com/docs/self-host/api/configuration)|IP address tracking and masking options.|-|Optional|
@@ -29,6 +29,7 @@ All options are passed to `c15tInstance()`. Only `adapter` and `trustedOrigins`
29
29
  |apiKeys|string\[] \|undefined|API keys for authenticated endpoints. Used for server-side endpoints like GET /subjects.|-|Optional|
30
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|
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
 
@@ -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)|
@@ -58,7 +58,7 @@ export const c15t = c15tInstance({
58
58
  uiMode: 'banner',
59
59
  banner: {
60
60
  allowedActions: ['accept', 'reject', 'customize'],
61
- primaryAction: 'customize',
61
+ primaryActions: ['accept', 'customize'],
62
62
  uiProfile: 'compact',
63
63
  },
64
64
  dialog: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c15t/backend",
3
- "version": "2.0.0-rc.5",
3
+ "version": "2.0.0-rc.8",
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",
@@ -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,31 +123,31 @@
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.3",
128
- "@c15t/translations": "2.0.0-rc.5",
126
+ "@c15t/logger": "1.0.2-rc.1",
127
+ "@c15t/schema": "2.0.0-rc.5",
128
+ "@c15t/translations": "2.0.0-rc.8",
129
129
  "@hono/standard-validator": "^0.2.2",
130
130
  "@hono/valibot-validator": "0.6.1",
131
- "@opentelemetry/api": "1.9.0",
132
- "@orpc/server": "^1.13.4",
133
- "@scalar/hono-api-reference": "0.5.175",
134
- "@valibot/to-json-schema": "1.0.0",
131
+ "@opentelemetry/api": "1.9.1",
132
+ "@orpc/server": "^1.13.13",
133
+ "@scalar/hono-api-reference": "0.10.5",
134
+ "@valibot/to-json-schema": "1.6.0",
135
135
  "base-x": "5.0.1",
136
136
  "defu": "6.1.4",
137
- "fumadb": "0.2.1",
138
- "hono": "4.11.7",
139
- "hono-openapi": "1.2.0",
140
- "jose": "6.2.1",
141
- "valibot": "1.2.0"
137
+ "fumadb": "0.2.2",
138
+ "hono": "4.12.9",
139
+ "hono-openapi": "1.3.0",
140
+ "jose": "6.2.2",
141
+ "valibot": "1.3.1"
142
142
  },
143
143
  "devDependencies": {
144
144
  "@c15t/typescript-config": "0.0.1-beta.1",
145
145
  "@c15t/vitest-config": "1.0.0",
146
- "@opentelemetry/sdk-trace-base": "^1.30.0",
147
- "@types/node": "24.10.1",
148
- "@upstash/redis": "^1.0.0",
146
+ "@opentelemetry/sdk-trace-base": "^2.6.1",
147
+ "@types/node": "25.5.0",
148
+ "@upstash/redis": "^1.37.0",
149
149
  "genversion": "3.2.0",
150
- "typescript": "5.9.3"
150
+ "typescript": "6.0.2"
151
151
  },
152
152
  "peerDependencies": {
153
153
  "@upstash/redis": ">=1.0.0"