Contentful Personalization & Analytics
    Preparing search index...

    Interface ConsentGuardInternal

    Contract implemented by classes that gate operations based on consent.

    These methods are consumed by the @guardedBy decorator to decide whether to proceed with an operation and how to report blocked calls.

    interface ConsentGuard {
        hasConsent: (name: string) => boolean;
        onBlockedByConsent: (name: string, args: unknown[]) => void;
    }

    Implemented by

    Index

    Properties

    hasConsent: (name: string) => boolean

    Determine whether the named operation is permitted given current consent and any allow‑list configuration.

    Type Declaration

      • (name: string): boolean
      • Parameters

        • name: string

          Logical operation/method name (e.g., 'track', 'page').

        Returns boolean

        true if the operation may proceed; otherwise false.

    The mapping between method names and event type strings may be product‑specific.

    onBlockedByConsent: (name: string, args: unknown[]) => void

    Hook invoked when an operation is blocked due to missing consent.

    Type Declaration

      • (name: string, args: unknown[]): void
      • Parameters

        • name: string

          The blocked operation/method name.

        • args: unknown[]

          The original call arguments, provided for diagnostics/telemetry.

        Returns void

        Nothing. Implementations typically log and/or emit diagnostics.