Types

Prev Next

ThemeType

type ThemeType = {
  colors: {
    black: string,
    white: string,
    layout: {
      mainPage: {
        left: {
          background: string,
        },
        right: {
          background: string,
        },
      },
      managePage: {
        left: {
          background: string,
        },
        right: {
          background: string,
        },
      },
      qrCode: {
        left: {
          background: string,
        },
        right: {
          background: string,
        },
      },
    },
    toggle: {
      on: {
        background: string,
      },
      off: {
        background: string,
      },
    },
    text: {
      color: string,
      color95: string,
      color90: string,
      color08: string,
    },
  },
  padding: {
    leftContainer: {
      mainPage: {
        vertical: number,
        horizontal: number,
      },
      managePage: {
        vertical: number,
        horizontal: number,
      },
      qrCode: {
        vertical: number,
        horizontal: number,
      },
    },
    rightContainer: {
      mainPage: {
        vertical: number,
        horizontal: number,
      },
      managePage: {
        vertical: number,
        horizontal: number,
      },
      qrCode: {
        vertical: number,
        horizontal: number,
      },
    },
    card: {
      vertical: number,
      horizontal: number,
    },
    dpsInfoCard: {
      vertical: number,
      horizontal: number,
    },
    qrCodeModal: {
      vertical: number,
      horizontal: number,
    },
  },
  font: {
    size: {
      layout: {
        large: number,
        medium: number,
      },
      button: {
        large: number,
        medium: number,
      },
      card: {
        large: number,
        medium: number,
      },
      cardList: {
        large: number,
        medium: number,
      },
      dpsInfoCard: {
        large: number,
        medium: number,
      },
      qrCodeModal: {
        large: number,
        medium: number,
      },
    },
    weight: {
      regular: number,
      semiBold: number,
    },
  },
  metrics: {
    mainPage: {
      leftContainer: {
        width: string,
      },
      rightContainer: {
        width: string,
      },
    },
    managePage: {
      leftContainer: {
        width: string,
      },
      rightContainer: {
        width: string,
      },
    },
  },
};

CmpButtonsType

type CmpButtonsType = 'accept' | 'deny' | 'more' | 'save' | 'ok';
ValueCorresponds to
accept"Accept All" button. Fires ACCEPT_ALL, calls acceptAllConsents(), saves consent, closes the CMP. Shown by default in most layouts.
deny"Deny All" button. Fires DENY_ALL, calls denyAllConsents(), saves and closes — unless TCF Consent-or-Pay is active, in which case it re-shows the first layer instead.
more"More Information" / "Manage Settings" link/button that opens the second layer. Fires MORE_INFORMATION_LINK. Never shown on the second layer itself; removed for Consent-or-Pay models.
save"Save" button — persists granular toggle selections rather than accept/deny-all. Fires SAVE, saves and closes the CMP.
okCombined "OK" button, US layer only. Distinct value for visibility/color/label purposes only — at runtime it renders with data-action-type="save" and behaves identically to save.

OptionalSettingsData

type OptionalSettingsData = string | null | undefined;

EmbeddingsTheme

type EmbeddingsTheme = CmpTheme;

ConsentActionType

export type ConsentActionType = 'onAcceptAllServices' | 'onDenyAllServices' | 'onEssentialChange' | 'onInitialPageLoad' | 'onNonEURegion' | 'onSessionRestored' | 'onTcfStringChange' | 'onUpdateServices' | 'onMobileSessionRestore';
ValueTypeFires when
onAcceptAllServicesExplicitAll consents/vendors/purposes accepted, via banner "Accept All" (GDPR/TCF) or a US/CCPA resolution with no opt-out.
onDenyAllServicesExplicit (except GPC path)All consents denied/opted out, via banner "Deny All", a US/CCPA opt-out, or an implicit GPC (Global Privacy Control) auto-deny when no prior consent exists.
onEssentialChangeImplicitFallback when stored consent no longer matches the current settings hash (config changed since last consent) and no more specific reason applies.
onInitialPageLoadImplicitDefault value for a brand-new consent record — first-time visitor, no prior session/consent data.
onNonEURegionImplicitReserved for visitors outside GDPR scope (non-EU).
onSessionRestoredImplicitReserved for a consent restored from a prior session without new user action.
onTcfStringChangeExplicitReserved for a consent record updated because the TCF string changed externally (e.g. synced from another source).
onUpdateServicesExplicitGranular/partial consent update — individual services, categories, TCF purposes/vendors/special features, or "Confirm choices"; also used for consent changes from embedded content.
onMobileSessionRestoreImplicitConsent session restored from the Usercentrics Mobile SDK rather than web interaction; suppresses banner resurfacing.

SettingType

type SettingType = 'TCF' | 'GDPR' | 'US';
ValueRegulation
GDPREU General Data Protection Regulation (non-IAB-framework deployment).
TCFIAB Transparency & Consent Framework (vendor-level consent, EU).
USUS state privacy laws — CCPA/CPRA and other US state laws.

ConsentType

type ConsentType = 'IMPLICIT' | 'EXPLICIT';
ValueMeaning
IMPLICITConsent set without an explicit user action — derived automatically (e.g. initial page load default, essential/config change, mobile session restore, or a GPC auto-deny). Assigned when the triggering consentActionType is one of: onEssentialChange, onInitialPageLoad, onNonEURegion, onSessionRestored, onMobileSessionRestore.
EXPLICITConsent resulted from a direct user action — accepting/denying all, or updating individual services/categories/TCF settings. Assigned when the triggering consentActionType is one of: onAcceptAllServices, onDenyAllServices, onTcfStringChange, onUpdateServices.