Kindnod

JavaScript API

Kindnod.consent            // { necessary, preferences, statistics, marketing, method } or null
Kindnod.show()             // open the banner (renew)
Kindnod.hide()
Kindnod.accept({ statistics: true, marketing: false })   // programmatic decision
Kindnod.withdraw()         // reject everything (reloads the page if something was granted)
Kindnod.reset()            // forget the stored decision and show the banner
Kindnod.on('consent', fn)  // fn({ consent, method, stamp })
Kindnod.version

Events on window:

Cookiebot-compatible surface

When Cookiebot compatibility is on (default), window.Cookiebot exists with consent, consented, declined, hasResponse, show(), hide(), renew(), withdraw(), submitCustomConsent(p, s, m), runScripts(), and getScript(url, async, cb). The events CookiebotOnLoad, CookiebotOnConsentReady, CookiebotOnAccept, CookiebotOnDecline, CookiebotOnDialogInit, CookiebotOnDialogDisplay, and CookiebotOnTagsExecuted fire on window, and CookiebotCallback_OnAccept-style global functions are called if defined.

Inline config (no account)

For static demos or self-hosting, set window.KindnodConfig before the script and omit data-site. Consent logging is then off. See the source of /demo.html.

Consent record format

Stored in the first-party cookie kindnod_consent:

{ "v": 1, "t": "stamp", "m": "explicit", "c": { "p": false, "s": true, "m": false }, "pr": "cookiebot", "r": "DE" }

m is the method: explicit (clicked), implied (country needs no consent), carried (adopted from Cookiebot), gpc (Global Privacy Control). pr is the previous CMP when carried.