Skip to main content

Parameters

Returns

An object containing a startPurchase function and a destroy method to control the purchase widget programmatically. Type of the response is CreatePurchaseResult.

Example

UI Configuration

The uiConfig parameter allows you to customize the visual appearance of the purchase widget by overriding the default color scheme.

Color Priority System

The purchase widget determines which colors to use based on a priority system:
  1. Highest Priority: uiConfig passed directly to createPurchase()
  2. Medium Priority: Experience configuration colors (if the offering is associated with an experience)
  3. Lowest Priority: Default Supertab colors (#ffffff for text, #000000 for background)

Example with Custom Colors

How Colors Affect the Widget

colors.text controls:
  • Button text (e.g., “Continue” button label)
  • Text color contrast on colored backgrounds
  • Any text overlaid on colored elements
colors.background controls:
  • Primary action button background (e.g., “Continue” button)
  • Progress indicator ring (Omega ring showing Tab balance)
  • Visual accents and highlights throughout the widget

Visual Examples

Default colors

Default widget appearance without custom uiConfig

Custom colors

Widget with custom colors: white text (#FFFFFF) and blue background (#0000FF)

The uiConfig always takes precedence over experience configuration colors. This ensures you have full control over the widget appearance when needed.
Ensure sufficient contrast between text and background colors for accessibility. Test your color combinations to verify readability.

Types

PurchaseStateSummary

PurchaseStateSummary type definition

CreatePurchaseResult

CreatePurchaseResult type definition

CreatePurchaseUiConfig

CreatePurchaseUiConfig type definition

Advanced Examples

Override Experience Colors

Conditional Color Theming

Full Implementation Example