Replies: 1 comment
-
You can retrieve categories via const cc = initCookieConsent();
cc.run({...});
const categories = cc.getConfig('languages')['en'].settings_modal.blocks
.filter(block => !!block.toggle)
.map(block => block.toggle.value);
// or
const preferences = cc.getUserPreferences();
const allCategories = [...preferences.accepted_categories, ...preferences.rejected_categories]; Replace |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Have everything configured and working great so far.
In one particular script, I am trying to walk through the list of configured categories. I can hard-code it, as I don't have that many, but I thought it would be much easier to access the "actual" configuration.
I thought something like this would work, but it is giving me "undefined".
The CC.categores is returning "undefined" and is therefore failing. Is the CC.categories ONLY at configuration?
Is there an equivalent runtime API to access the POSSIBLE categories?
Beta Was this translation helpful? Give feedback.
All reactions