Skip to content

isCookieInformationEnabled(): boolean

The isCookieInformationEnabled method allows to check whether the cookies are enabled in the store or not.

Input parameters

none

Returned value

A returned value has a type of boolean representing whether the cookies are currently enabled in the store or not.

Example

In this example we make a customerPrivacyApi call to see if the cookies are currently enabled in the store.

useStorefront((storefront) => {
    const customerPrivacyApi = await storefront.getApi('customerPrivacyApi');

    const isCookieInformationEnabled = customerPrivacyApi.isCookieInformationEnabled();

    if (isCookieInformationEnabled) {
        // do something
    }
});

Customer Privacy API methods reference