Hierarchy

  • default

Constructors

  • Parameters

    • ucId: string

      Your unique Usercentrics Id - settingsId or rulesetId

    • Optional options: InitOptions

      Additional options for initialization of the SDK. Note especially the createTcfApiStub property which is necessary for TCF UIs.

    Returns default

CCPA Methods

  • Retrieve explicit notice status of ccpa

    Returns boolean

  • Retrieve optout status of ccpa

    Returns boolean

  • Don't perform any changes on consent level. Stores the timestamp, the privacy strings and sets userActionPerformed

    Returns Promise<void>

  • Set optout status in cookie for user and save string in backend

    Parameters

    • isOptedOut: boolean

      User's decision on all consents

    • consentType: CONSENT_TYPE = CONSENT_TYPE.EXPLICIT

    Returns Promise<void>

GPP Methods

  • Mark the GPP Display as being hidden

    Returns Promise<void>

  • Mark the GPP Display as being visible

    Returns Promise<void>

General Methods

  • Return if the user accepted all consents

    Returns boolean

  • Change the language. All upcoming SDK calls will return information in this language (e.g. getSettingsCore(),getCategories(), getTCFData(), ...). Pay attention that the language needs to be set up in your Usercentrics Admin Interface before!

    Parameters

    • language: string

      The language to switch to (ISO 639-1 code)

    Returns Promise<void>

  • Retrieve aria labels

    Returns LegacyAriaLabelsTranslations

  • Retrieve the controllerId, that's generated for the user.

    Returns string

  • Checks if consent is required (not given yet/resurface of banner)

    Returns

    true: consent is required, false: consent is not required, null: consent requirement is not known (yet)

    Returns null | boolean

  • Return the number of third party ervices

    Returns

    the count of third party services

    Returns number

  • Initializes the Usercentrics framework. This method must be called when loading your website. The return value defines which UI layer & variant you should initially show for your users.

    Returns Promise<InitialUIValues>

  • Set user action performed. Only needed if a user action is performed without the need for an explicit consent (e.g. CCPA first layer implementation)

    Returns Promise<void>

Non-TCF Methods

  • Mark all services as "Consent given" (e.g. an "Accept All" button was clicked). The SDK will store the consent information and trigger events depending on your Usercentrics Settings.

    Parameters

    • consentType: CONSENT_TYPE = CONSENT_TYPE.EXPLICIT

      The manner in which the consent was given (explicit vs. implicit). Default: explicit.

    Returns Promise<void>

  • Mark all services as "Consent denied" (e.g. a "Deny All" button was clicked). Essential services will still be marked as "Consent given". The SDK will store the consent information and trigger events depending on your Usercentrics Settings.

    Parameters

    • consentType: CONSENT_TYPE = CONSENT_TYPE.EXPLICIT

      The manner in which the consent was denied (explicit vs. implicit). Default: explicit.

    Returns Promise<void>

  • Retrieve boolean, that can be used to decide if the user is inside the EU or not.

    Returns Promise<boolean>

  • Retrieve the categories and their full services info to display this information in your UI.

    Returns Promise<Category[]>

  • Restore a session for an end user with the given controllerId.

    Parameters

    • controllerId: string

      User's generated controllerId. NOTE: Always use a controllerId provided by the SDK.

    Returns Promise<void>

  • Mark given services as "Consent given / denied". Essential services will still be marked as "Consent given". The SDK will store the consent information and trigger events depending on your Usercentrics Settings.

    Parameters

    • decisions: UserDecision[]

      The user's decisions for individual services (see interface definition for details)

    • consentType: CONSENT_TYPE = CONSENT_TYPE.EXPLICIT

      The manner in which the consent was given/denied (explicit vs. implicit). Default: explicit.

    Returns Promise<void>

Other Methods

  • Accept all services for AMP

    Returns Promise<void>

  • Clear the storage from all buckets

    Returns Promise<void>

  • Reject all services for AMP

    Returns Promise<void>

  • Dismiss UI for AMP - this closes the AMP UI and also don't change the consent. If a consent has already been given, AMP uses that as the current state.

    Returns Promise<void>

  • Needed for enabling dynamically loaded script.

    Returns void

  • Enter fullscreen mode on AMP UI

    Returns Promise<void>

  • Returns Promise<{
        core: CoreJsonResponse;
        dps: DpsJsonResponse;
    }>

  • Retrieve ab testing variant in use.

    Returns string

  • Fetch service data from the aggregator if the data wasn't fetched already

    Returns Promise<void>

  • Returns Promise<LegacySettings>

  • This method sends the message to the parent iframe to communicate the user's decisions

    Parameters

    • type: AMP_CONSENT_TYPE

      the AMP consent type

    • action: AMP_CONSENT_ACTION

      the AMP consent action

    • Optional initialHeight: string

    Returns Promise<void>

  • Save current TCF data based on user decisions according to the rules below:

    • if there are only TCF vendors and no non-IAB-service - we signal accept
    • if the are non-IAB services and ALL of them have a consent we signal accept
    • if the are non-IAB services and at least ONE of them has NO consent we signal reject

    Parameters

    Returns Promise<void>

  • Sends the ready message to display the AMP UI

    Returns Promise<void>

  • Parameters

    • previousServices: StorageService[]
    • Optional storageDataTransferObjects: DataTransferObject[]
    • Optional isRestoreSession: boolean

    Returns Promise<void>

TCF Methods

  • Mark all disclosed TCF vendors, purposes, specialFeatures as "consent given" and if applicable "legitimate interest given". The SDK will store the consent information and trigger TCF events. NOTE: This function will also mark the TCF UI as being closed! No need to call the setTCFUIAsClosed() method.

    Parameters

    • fromLayer: TCF_DECISION_UI_LAYER

      The layer from which the consent was given/denied (firstLayer vs. secondLayer).

    Returns Promise<void>

  • Mark all disclosed TCF vendors, purposes, specialFeatures as "consent denied" and if applicable "legitimate interest denied". The SDK will store the consent information and trigger TCF events. NOTE: This function will also mark the TCF UI as being closed! No need to call the setTCFUIAsClosed() method.

    Parameters

    • fromLayer: TCF_DECISION_UI_LAYER

      The layer from which the consent was given/denied (firstLayer vs. secondLayer).

    Returns Promise<void>

  • Retrieve all TCF data, including consents and descriptions for TCF vendors, purposes, special purposes, features, special features, and stacks Only vendors and stacks that have been selected in the admin interface will be returned. Only purposes, features, special features, special purposes that are used by one or more of the selected vendors (and/or selected stacks) will re returned.

    Returns null | TCFData

  • A method to return TCF disclosed vendors as an encoded segment

    Returns

    the TCF disclosed vendors segment or undefined

    Returns undefined | string

  • Inject a tcString

    Returns

    boolean true if injected successfully, false otherwise

    Parameters

    • tcString: string

      the tcString to inject

    Returns Promise<boolean>

  • Mark the TCF UI as being closed and trigger related TCF events. NOTE: Remember to call this ALWAYS when an end-user closes your TCF UI without making any changes!

    Returns Promise<void>

  • Mark the TCF UI as being open and trigger related TCF events. NOTE: Remember to call this ALWAYS when an end-user opens up your TCF UI!

    Returns Promise<void>

  • Mark given TCF vendors, purposes, specialFeatures as "consent given / denied" and if applicable "legitimate interest given denied". The SDK will store the consent information and trigger TCF events. NOTE: This function will also mark the TCF UI as being closed! No need to call the setTCFUIAsClosed() method.

    Parameters

    • decisions: TCFUserDecisions

      The user's decisions for individual TCF vendors, purposes, specialFeatures (see interface definition for details)

    • fromLayer: TCF_DECISION_UI_LAYER

      The layer from which the consent was given/denied (firstLayer vs. secondLayer).

    Returns Promise<void>