Skip to content

ConsentConfig

type ConsentConfig = {
categories: Record<CategoryId, CategoryDefinition>;
cloud: {
apiKey: string;
endpoint: string;
};
consentMode: ConsentModeMapping;
jurisdiction: Jurisdiction | "auto";
policy: {
url: string;
version: string;
};
storage: StorageOptions;
};

Defined in: types.ts:114

Type declaration

NameTypeDescriptionDefined in
categoriesRecord<CategoryId, CategoryDefinition>Map of category ID to definition. The keys are arbitrary (e.g. ‘analytics’, ‘marketing’).types.ts:121
cloud?{ apiKey: string; endpoint: string; }Cloud configuration. If omitted, the SDK runs entirely client-side with no telemetry.types.ts:128
cloud.apiKey?string-types.ts:129
cloud.endpoint?stringOverride the default ingest endpoint. Useful for self-hosting.types.ts:131
consentMode?ConsentModeMappingOverride the default Tickbox-category → Google Consent Mode v2 key mapping. Merged shallowly with the built-in defaults.types.ts:139
jurisdictionJurisdiction | "auto"The jurisdiction governing this site, or 'auto' to detect by visitor country. ‘auto’ falls back to the strictest available match.types.ts:119
policy?{ url: string; version: string; }Versioned policy reference. Audit log entries are tied to a policy version.types.ts:123
policy.url?string-types.ts:125
policy.versionstring-types.ts:124
storage?StorageOptionsCookie storage options.types.ts:134