API documentation seems out of date
tpinne opened this issue · comments
https://heyklaro.com/docs/api/js_api seems out of date.
What's currently unavailable at the global klaro
object:
klaro.initialize()
klaro.updateAppElements(app, consent)
orklaro.getManager().updateAppElements(app, consent)
klaro.updateAppCookies(app, consent)
orklaro.getManager().updateAppCookies(app, consent)
What's currently available at the global klaro
object but with a different name:
getApp() --> getService()
Yes we'll update this!
Does this function allow you to activate a service once without saving it in the Consent Manager? If so, what should the call be? My dirty Workaround:
<a href="#" onclick="klaro.getManager().updateConsent('googlemaps', true);klaro.getManager().saveAndApplyConsents();klaro.getManager().updateConsent('googlemaps', false);klaro.getManager().saveConsents(); return false;" style="cursor:pointer;">Allow once</a>
What is the current equivalent to reset the the consent? Right now, since I am using local storage I am manually clearing it, but unless the page is reloaded we can't show the basic consent window:
function resetConsent () {
localStorage.removeItem(klaroConfig.storageName);
klaro.show();
}
This is not a deal breaker, since for us this is a bit of an edge case.
What is the current equivalent to reset the the consent?
You can do that via the ConsentManager: window.klaro.getManager().resetConsents();
https://klaro.org/docs/api/js_api#ConsentManager.resetConsents