Configuration object for initializing the Purchases SDK.

// Object-based configuration (recommended)
const purchases = Purchases.configure({
apiKey: "your_api_key",
appUserId: "user_123",
httpConfig: { additionalHeaders: { "Custom-Header": "value" } },
flags: { autoCollectUTMAsMetadata: true }
});

// Legacy separate arguments (deprecated)
const purchases = Purchases.configure(
"your_api_key",
"user_123",
{ additionalHeaders: { "Custom-Header": "value" } },
{ autoCollectUTMAsMetadata: true }
);
interface PurchasesConfig {
    apiKey: string;
    appUserId: string;
    brandingAppearanceOverride?: Partial<BrandingAppearance>;
    flags?: FlagsConfig;
    httpConfig?: HttpConfig;
}

Properties

apiKey: string

RevenueCat API Key. Can be obtained from the RevenueCat dashboard.

appUserId: string

Your unique id for identifying the user.

brandingAppearanceOverride?: Partial<BrandingAppearance>

Overrides the Dashboard branding appearance for purchases created by this instance, including purchases started through Purchases.presentPaywall. Only the provided values are overridden. A value passed directly to PurchaseParams.brandingAppearanceOverride takes precedence for that purchase.

For Stripe Checkout, this customizes the supported mobile wallet experience. The Stripe-hosted fallback opened through "Pay another way" remains light and cannot currently be customized.

flags?: FlagsConfig

Advanced functionality configuration FlagsConfig.

httpConfig?: HttpConfig

Advanced http configuration to customise the SDK usage HttpConfig.