klaro-js icon indicating copy to clipboard operation
klaro-js copied to clipboard

API documentation seems out of date

Open tpinne opened this issue 4 years ago • 5 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()

tpinne avatar Mar 25 '21 10:03 tpinne

Yes we'll update this!

adewes avatar Apr 05 '21 20:04 adewes

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>

robinson2 avatar Jan 27 '23 17:01 robinson2

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 avatar Nov 03 '23 21:11 ajmas

@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

saitho avatar Feb 07 '24 13:02 saitho