SDK Web API (options & events)
Init options
| Option | Type | Default | Description |
|---|---|---|---|
region | 'auto' | 'eu-eea' | 'uk' | 'us-nat' | 'us-ca' | 'row' | 'auto' | Auto‑select the right framework; choose a fixed region only for testing. |
regionEndpoint | string | '/api/v1/region' | HTTP endpoint that returns { region, framework }. |
regionRequestTimeoutMs | number | 1200 | Abort timeout for the region request (ms). |
regionFallback | 'eu-eea' | 'uk' | 'us-nat' | 'row' | 'eu-eea' | Safe default while region resolves. |
siteKey | string | — | Your Site Key (used for session cache keying). |
cacheTtlMs | number | 30 * 60 * 1000 | Session cache TTL for region decision (ms). |
Events (dataLayer‑friendly)
| Event | When it fires | Payload |
| ------------ | ------------------------- | --------------------------------------------------- | ------- |
| cmp_accept | User accepts any category | region, framework, tcfString/gppString, sections? |
| cmp_reject | User rejects | same |
| cmp_open | Preferences opened | source: 'banner' | 'link' |
Helpers
window.DWConsent.open()— reopen the banner (link it from your footer).window.DWConsent.debug.regionDecision()— returns{ region, framework, source, at }.