klaro-org / klaro-js

Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.

Home Page:https://klaro.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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) or klaro.getManager().updateAppElements(app, consent)
  • klaro.updateAppCookies(app, consent) or klaro.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!

commented

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.

@ajmas

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