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;
    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.

flags?: FlagsConfig

Advanced functionality configuration FlagsConfig.

httpConfig?: HttpConfig

Advanced http configuration to customise the SDK usage HttpConfig.