@ueberbit/consent-manager
v0.0.11
Published
This tool is a thin wrapper arund consent tools. It offers a unified api to interact with different consent tools. It provides events, magic attributes/classes and placeholders to make it easy to use. This also works for providers which do not natively ex
Readme
Consent Tool
This tool is a thin wrapper arund consent tools. It offers a unified api to interact with different consent tools. It provides events, magic attributes/classes and placeholders to make it easy to use. This also works for providers which do not natively expose these api's.
Installation
pnpm i @ueberbit/consent-managerUsage
auto detection
import '@ueberbit/consent-manager'
window.addEventListener('ConsentManager:onLoad', ({ detail }) => {
console.log('ConsentManger:onLoad', detail)
})manual
import { ConsentManager } from '@ueberbit/consent-manager/ConsentManager'
import { CookiebotProvider } from '@ueberbit/consent-manager/providers/CookieBot'
globalThis.ConsentManager = new ConsentManager(new CookiebotProvider())
window.addEventListener('ConsentManager:onLoad', ({ detail }) => {
console.log('ConsentManger:onLoad', detail)
})Providers
Cookiebot
import { CookiebotProvider } from '@ueberbit/consent-manager/providers/CookieBot'Etracker
import { EtrackerProvider } from '@ueberbit/consent-manager/providers/Etracker'