Main class to manage cookie consents within your application.

Type Parameters

Hierarchy

  • CookieConsentManager

Constructors

  • Type Parameters

    • Transaction extends Partial<{
          createdClientTime: string;
          decision: "essentials" | "all" | DecisionConsentGroups;
          gcmConsent: EServiceTemplateGoogleConsentModeTypes[];
          revision: string;
          tcfString: string;
      }> = any

    Parameters

    Returns CookieConsentManager<Transaction>

Properties

_boradcastChannel: BroadcastChannel
options: CookieConsentManagerOptions<Transaction>
BROADCAST_SIGNAL_APPLY_COOKIES: string = "applyCookies"

Accessors

  • get broadcastChannel(): BroadcastChannel
  • A global broadcast channel for this cookie consent management.

    Returns BroadcastChannel

Methods

  • Parameters

    • options: Pick<{
          type: "essentials" | "all" | "consent";
      } & Pick<CookieConsentManagerOptions, "isGcm" | "setCookiesViaManager" | "groups" | "decisionCookieName"> & ApplyOptInOptions, "type">
    • broadcast: boolean = true

    Returns Promise<void>

  • Returns Partial<{
        createdClientTime: string;
        decision: "essentials" | "all" | DecisionConsentGroups;
        gcmConsent: EServiceTemplateGoogleConsentModeTypes[];
        revision: string;
        tcfString: string;
    }>[]

  • Parameters

    • lock: boolean = false

    Returns string

  • Parameters

    • respectLegitimateInterests: boolean = true

    Returns DecisionConsentGroups

  • Parameters

    • Optional onlyUptoDate: boolean

    Returns false | Decision

  • Parameters

    • Optional set: boolean

    Returns boolean

  • If you have passed a persistConsent as option to the manager constructor, you can use this method. This method wraps your passed callback and if an error occurs, it accordingly handles the error and pushes the transaction into a queue. The queue has a lifecycle to get retried at a later stage when e.g. your server is available again.

    Parameters

    • transaction: Transaction

    Returns Promise<void>

  • Parameters

    • queue: Partial<{
          createdClientTime: string;
          decision: "essentials" | "all" | DecisionConsentGroups;
          gcmConsent: EServiceTemplateGoogleConsentModeTypes[];
          revision: string;
          tcfString: string;
      }>[]

    Returns void

Generated using TypeDoc