Skip to content

grantNecessaryConsents

grantNecessaryConsents is a DOM event that occurs whenever just the necessary consents are granted.

Event body

none

Example

In this example we listen to grantNecessaryConsents event and perform an action whenever it's emitted.

useStorefront(async (storefront) => {
    document.addEventListener('grantNecessaryConsents', () => {
        console.log('Necessary consents have been granted');
    });
});