withdrawConsents(consents: TConsentName[]): void¶
The withdrawConsents
method allows to withdraw a given array of consents.
Input parameters¶
consents¶
consents
is a mandatory parameter of the TConsentName[]
type which represents an array of consents to grant. To see all the possible consent names see the Consent names section of the Customer Privacy API.
Returned value¶
A returned value has a type of void
as this method does not return anything.
Example¶
In this example we make a customerPrivacyApi
call to withdraw a given array of consents.
useStorefront((storefront) => {
const customerPrivacyApi = await storefront.getApi('customerPrivacyApi');
customerPrivacyApi.withdrawConsents(['analyticsConsent']);
});
Customer Privacy API methods reference¶
- getGrantedNames
- grantConsents
- onAnalyticsConsentGranted
- onMarketingConsentGranted
- onFunctionalConsentGranted
- onPlatformConsentGranted
- showConsentsModal
- showAdvancedConsentsModal
- saveConsents
- isCookieInformationEnabled