Guide
Data Protection
1min
by default, data protection is turned off in the sdk this means that the sdk will read and write from the browser's storage (localstorage, cookies, etc) for customers who need to comply with data protection rules, you can enable data protection in the sdk by setting useconsent to true when this setting is enabled, consent must be given for each session using the sdk using consentgiven with a value set to true you can use the following code snippet as an example to enable it klevuconfig init({ url "https //eucs23v2 ksearchnet com/cs/v2/search", apikey "klevu 160320037354512854", useconsent true, //either set it to true during initialization consentgiven true, //either set it to true during initialization }) // or klevuconfig getdefault() setuseconsent(true) klevuconfig getdefault() setconsentgiven(true) // when you receive the user consent you can either add values per user session within klevuconfig init or by calling the methods available to klevuconfig as shown above