OptionalhelperScriptOptions: {The options for the helper script. This are the same options required as for Assets.php#anonymous_localize_script.
This is used to parse the JSON strings lazily when the helper script is not executed.
const options = getAnonymousLocalizedScript(process.env.slug, {
makeBase64Encoded: ["codeOptIn", "codeOptOut", "codeOnPageLoad", "contactEmail"],
lazyParse: (obj, parseLazy) => {
parseLazy(obj.others, "frontend", "groups");
parseLazy(obj.others, "frontend", "tcf");
parseLazy(obj, "others", "customizeValuesBanner");
},
});
Get the anonymous localized script from the document as object and write it to the window object.
Use it in combination with
Assets.php#anonymous_localize_script.