Interface PurchasesConfiguration

Holds parameters to initialize the SDK.

interface PurchasesConfiguration {
    apiKey: string;
    appUserID?: null | string;
    entitlementVerificationMode?: ENTITLEMENT_VERIFICATION_MODE;
    pendingTransactionsForPrepaidPlansEnabled?: boolean;
    purchasesAreCompletedBy?: PurchasesAreCompletedBy;
    shouldShowInAppMessagesAutomatically?: boolean;
    storeKitVersion?: STOREKIT_VERSION;
    useAmazon?: boolean;
    userDefaultsSuiteName?: string;
}

Properties

apiKey: string

RevenueCat API Key. Needs to be a string

appUserID?: null | string

A unique id for identifying the user

entitlementVerificationMode?: ENTITLEMENT_VERIFICATION_MODE

Verification strictness levels for [EntitlementInfo]. See https://rev.cat/trusted-entitlements for more info.

pendingTransactionsForPrepaidPlansEnabled?: boolean

Enable this setting if you want to allow pending purchases for prepaid subscriptions (only supported in Google Play). Note that entitlements are not granted until payment is done. Disabled by default.

purchasesAreCompletedBy?: PurchasesAreCompletedBy

Set this to MY_APP and provide a STOREKIT_VERSION if you have your own IAP implementation and want to only use RevenueCat's backend. Defaults to PURCHASES_ARE_COMPLETED_BY_TYPE.REVENUECAT.

If you are on Android and setting this to MY_APP, will have to acknowledge the purchases yourself. If your app is only on Android, you may specify any StoreKit version, as it is ignored by the Android SDK.

shouldShowInAppMessagesAutomatically?: boolean

Whether we should show store in-app messages automatically. Both Google Play and the App Store provide in-app messages for some situations like billing issues. By default, those messages will be shown automatically. This allows to disable that behavior, so you can display those messages at your convenience. For more information, check: https://rev.cat/storekit-message and https://rev.cat/googleplayinappmessaging

storeKitVersion?: STOREKIT_VERSION

iOS-only, will be ignored for Android.

By selecting the DEFAULT value, RevenueCat will automatically select the most appropriate StoreKit version for the app's runtime environment.

  • Warning: Make sure you have an In-App Purchase Key configured in your app. Please see https://rev.cat/in-app-purchase-key-configuration for more info.

  • Note: StoreKit 2 is only available on iOS 16+. StoreKit 1 will be used for previous iOS versions regardless of this setting.

useAmazon?: boolean

An optional boolean. Android only. Required to configure the plugin to be used in the Amazon Appstore.

userDefaultsSuiteName?: string

An optional string. iOS-only, will be ignored for Android. Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults.