- consent(...args): Promise<{
consentGiven: boolean;
cookie: Service;
cookieOptIn: boolean;
}> Parameters
Rest
...args: [manager: CookieConsentManager<any>, typeOrIdOrUniqueName: string | number, name?: string, host?: string]
Returns Promise<{
consentGiven: boolean;
cookie: Service;
cookieOptIn: boolean;
}>
window.consentApi.consent
: Check if a given technical information (e.g. HTTP Cookie, LocalStorage, ...) has a consent:Example (ES5):
Example (ES6, TS):
Since 2.3.0: You can also check for consent by cookie ID (ID in
wp_posts
, post id):Since 3.4.14: You can also check for consent by service unique name: