Skip to content

defineConsent

function defineConsent<T>(config): T

Defined in: define-consent.ts:20

Identity helper that narrows the type of a consent config so users get full autocomplete + type-checking in their consent.config.ts.

Type Parameters

Type Parameter
T extends ConsentConfig

Parameters

ParameterType
configT

Returns

T

Example

import { defineConsent, jurisdictions } from '@tickboxhq/core'
export default defineConsent({
jurisdiction: jurisdictions.UK_DUAA,
categories: {
necessary: { required: true },
analytics: { vendors: ['plausible'] },
},
})