Static
Readonly
BILLING_Static
Readonly
ENTITLEMENT_Enum of entitlement verification modes.
+Static
Readonly
INTRO_Enum of different possible states for intro price eligibility status.
+Static
Readonly
IN_List of valid in app message types.
+Static
Readonly
LOG_List of valid log levels.
+Static
Readonly
PACKAGE_Enumeration of all possible Package types.
+Static
Readonly
PRODUCT_Supported product categories.
+Static
Readonly
PRORATION_Replace SKU's ProrationMode.
+Static
Readonly
PURCHASES_Enum of PurchasesAreCompletedByType.
+Static
Readonly
PURCHASES_Enum of all error codes the SDK produces.
+Static
Readonly
PURCHASE_Supported SKU types.
+@deprecated, use PRODUCT_CATEGORY
+Static
Readonly
REFUND_Enum with possible return states for beginning refund request.
+Static
Readonly
STOREKIT_Enum of StoreKit version.
+Static
Readonly
VERIFICATION_The result of the verification process.
+Static
addSets a function to be called on updated customer info
+CustomerInfo update listener
+Static
addSets a function to be called on purchases initiated on the Apple App Store. This is only used in iOS.
+Called when a user initiates a +promotional in-app purchase from the App Store. If your app is able to handle a purchase at the current time, run +the deferredPurchase function. If the app is not in a state to make a purchase: cache the deferredPurchase, then +call the deferredPurchase when the app is ready to make the promotional purchase. +If the purchase should never be made, you don't need to ever call the deferredPurchase and the app will not +proceed with promotional purchases.
+Static
beginiOS 15+ only. Presents a refund request sheet in the current window scene for +the latest transaction associated with the active entitlement.
+If the request was unsuccessful, no active entitlements could be found for
+the user, or multiple active entitlements were found for the user,
+the promise will return an error.
+If called in an unsupported platform (Android or iOS < 15), an UnsupportedPlatformException
will be thrown.
Important: This method should only be used if your user can only have a single active entitlement at a given time.
+If a user could have more than one entitlement at a time, use beginRefundRequestForEntitlement
instead.
Returns REFUND_REQUEST_STATUS: The status of the + refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
+Static
beginiOS 15+ only. Presents a refund request sheet in the current window scene for
+the latest transaction associated with the entitlement
.
If the request was unsuccessful, the promise will return an error.
+If called in an unsupported platform (Android or iOS < 15), an UnsupportedPlatformException
will be thrown.
The entitlement to begin a refund request for.
+Returns REFUND_REQUEST_STATUS: The status of the + refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
+Static
beginiOS 15+ only. Presents a refund request sheet in the current window scene for
+the latest transaction associated with the product
.
If the request was unsuccessful, the promise will return an error.
+If called in an unsupported platform (Android or iOS < 15), an UnsupportedPlatformException
will be thrown.
The StoreProduct to begin a refund request for.
+Returns a REFUND_REQUEST_STATUS: The status of the + refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
+Static
canCheck if billing is supported for the current user (meaning IN-APP purchases are supported) +and optionally, whether a list of specified feature types are supported.
+Note: Billing features are only relevant to Google Play Android users. +For other stores and platforms, billing features won't be checked.
+An array of feature types to check for support. Feature types must be one of + [BILLING_FEATURE]. By default, is an empty list and no specific feature support will be checked.
+promise with boolean response. True if billing is supported, false otherwise.
+Static
checkiOS only. Computes whether or not a user is eligible for the introductory pricing period of a given product. +You should use this method to determine whether or not you show the user the normal product price or the +introductory price. This also applies to trials (trials are considered a type of introductory pricing).
+Array of product identifiers for which you want to compute eligibility
+A map of IntroEligility per productId. The promise +will be rejected if configure has not been called yet or if there's in an error checking eligibility.
+Subscription groups are automatically collected for determining eligibility. If RevenueCat can't
+definitively compute the eligibility, most likely because of missing group information, it will return
+INTRO_ELIGIBILITY_STATUS_UNKNOWN
. The best course of action on unknown status is to display the non-intro
+pricing, to not create a misleading situation. To avoid this, make sure you are testing with the latest version of
+iOS so that the subscription group can be collected by the SDK. Android always returns INTRO_ELIGIBILITY_STATUS_UNKNOWN.
Static
collectAutomatically collect subscriber attributes associated with the device identifiers. +$idfa, $idfv, $ip on iOS +$gpsAdId, $androidId, $ip on Android
+The promise will be rejected if configure has not been called yet or if there's an error +setting collecting the device identifiers.
+Static
configureSets up Purchases with your API key and an app user id.
+If you use purchasesAreCompletedBy=PurchasesAreCompletedByMyApp, you must also provide a value for storeKitVersion.
+Static
enableStatic
getStatic
getRetrieves a current offering for a placement identifier, use this to access offerings defined by targeting +placements configured in the RevenueCat dashboard.
+The placement identifier to fetch a current offeringn for
+Promise of an optional offering. The promise will be rejected if configure +has not been called yet.
+Static
getGets current customer info
+A promise of a customer info object. Rejections return an error code, and an +userInfo object with more information. The promise will be rejected if configure has not been called yet or if +there's an issue getting the customer information.
+Static
getiOS only. Use this function to retrieve the eligible PurchasesWinBackOffer
s that a subscriber
+is eligible for for a given PurchasesPackage
.
The PurchasesPackage
the user intends to purchase.
Returns an array of win-back offers that the subscriber is eligible for. +Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been +called yet or if there's an error getting the payment discount.
+Static
getiOS only. Use this function to retrieve the eligible PurchasesWinBackOffer
s that a subscriber
+is eligible for for a given PurchasesProduct
.
The PurchasesStoreProduct
the user intends to purchase.
Returns an array of win-back offers that the subscriber is eligible for. +Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been +called yet or if there's an error getting the payment discount.
+Static
getGets the map of entitlements -> offerings -> products
+Promise of entitlements structure. The promise will be rejected if configure +has not been called yet.
+Static
getFetch the product info
+Array of product identifiers
+Optional type of products to fetch, can be SUBSCRIPTION or NON_SUBSCRIPTION. SUBSCRIPTION by default
+A promise containing an array of products. The promise will be rejected +if the products are not properly configured in RevenueCat or if there is another error retrieving them. +Rejections return an error code, and a userInfo object with more information. The promise will also be rejected +if configure has not been called yet.
+Static
getiOS only. Use this function to retrieve the PurchasesPromotionalOffer
for a given PurchasesPackage
.
The PurchasesStoreProduct
the user intends to purchase.
The PurchasesStoreProductDiscount
to apply to the product.
Returns when the PurchasesPaymentDiscount
is returned.
+Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been
+called yet or if there's an error getting the payment discount.
Static
invalidateInvalidates the cache for customer information.
+Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state. +Refer to https://docs.revenuecat.com/docs/customer-info#section-get-user-information for more information on +using the cache properly.
+This is useful for cases where customer information might have been updated outside of the app, like if a +promotional subscription is granted through the RevenueCat dashboard.
+The promise will be rejected if configure has not been called yet or there's an error +invalidating the customer info cache.
+Static
isStatic
isStatic
logThis function will logIn the current user with an appUserID. Typically this would be used after a log in +to identify a user without calling configure.
+The appUserID that should be linked to the currently user
+A promise of an object that contains the customerInfo after logging in, as well +as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The +promise will be rejected if configure has not been called yet or if there's an issue logging in.
+Static
logLogs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
+A promise of a customer info object. Rejections return an error code, +and a userInfo object with more information. The promise will be rejected if configure has not been called yet or if +there's an issue logging out.
+Static
presentiOS only. Presents a code redemption sheet, useful for redeeming offer codes +Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how +to configure and use offer codes
+The promise will be rejected if configure has not been called yet or there's an error +presenting the code redemption sheet.
+Static
purchaseiOS only. Purchase a package applying a given discount.
+The Package you wish to purchase. You can get the Packages by calling getOfferings
+Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
+A promise of an object containing +a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the +user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure +has not been called yet.
+Static
purchaseiOS only. Purchase a product applying a given discount.
+The product you want to purchase
+Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
+A promise of an object containing +a customer info object and a product identifier. Rejections return an error code, +a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be +rejected if configure has not been called yet.
+Static
purchaseMake a purchase
+The Package you wish to purchase. You can get the Packages by calling getOfferings
+Optional
upgradeInfo: null | UpgradeInfoDEPRECATED. Use googleProductChangeInfo.
+Optional
googleProductChangeInfo: null | GoogleProductChangeInfoAndroid only. Optional GoogleProductChangeInfo you +wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
+Optional
googleIsPersonalizedPrice: null | booleanAndroid and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. +For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true. +See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
+A promise of an object containing +a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the +user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure +has not been called yet.
+Static
purchaseiOS only. Purchase a package applying a given win-back offer.
+Only available on iOS 18.0+ when StoreKit 2 is enabled.
+Win-back offer to apply to this package. Retrieve this offer using getEligibleWinBackOffers.
+A promise of an object containing +a customer info object and a product identifier. Rejections return an error code, +a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be +rejected if configure has not been called yet.
+Static
purchaseMake a purchase
+The product identifier of the product you want to purchase
+Optional
upgradeInfo: null | UpgradeInfoAndroid only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU +and the optional prorationMode.
+Optional type of product, can be inapp or subs. Subs by default +@deprecated, use purchaseStoreProduct instead
+Static
purchaseiOS only. Purchase a product applying a given win-back offer.
+Only available on iOS 18.0+ when StoreKit 2 is enabled.
+The product you want to purchase
+Win-back offer to apply to this package. Retrieve this offer using getEligibleWinBackOffers.
+A promise of an object containing +a customer info object and a product identifier. Rejections return an error code, +a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be +rejected if configure has not been called yet.
+Static
purchaseMake a purchase
+The product you want to purchase
+Optional
googleProductChangeInfo: null | GoogleProductChangeInfoAndroid only. Optional GoogleProductChangeInfo you +wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
+Optional
googleIsPersonalizedPrice: null | booleanAndroid and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. +For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true. +See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
+A promise of an object containing +a customer info object and a product identifier. Rejections return an error code, +a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will +also be rejected if configure has not been called yet.
+Static
purchaseGoogle only. Make a purchase of a subscriptionOption
+The SubscriptionOption you wish to purchase. You can get the SubscriptionOption from StoreProducts by calling getOfferings
+Optional
googleProductChangeInfo: GoogleProductChangeInfoAndroid only. Optional GoogleProductChangeInfo you +wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
+Optional
googleIsPersonalizedPrice: booleanAndroid and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. +For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true. +See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
+A promise of an object containing +a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the +user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure +has not been called yet.
+Static
recordiOS only. Always returns an error on iOS < 15.
+Use this method only if you already have your own IAP implementation using StoreKit 2 and want to use +RevenueCat's backend. If you are using StoreKit 1 for your implementation, you do not need this method.
+You only need to use this method with new purchases. Subscription updates are observed automatically.
+Important: This should only be used if you have set PurchasesAreCompletedBy to MY_APP during SDK configuration.
+Product ID that was just purchased
+If there was a transacton found and handled for the provided product ID.
+You need to finish the transaction yourself after calling this method.
+Static
removeRemoves a given CustomerInfoUpdateListener
+CustomerInfoUpdateListener reference of the listener to remove
+True if listener was removed, false otherwise
+Static
removeRemoves a given ShouldPurchasePromoProductListener
+ShouldPurchasePromoProductListener reference of +the listener to remove
+True if listener was removed, false otherwise
+Static
restoreRestores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
+A promise of a customer info object. Rejections return an error code, and an +userInfo object with more information. The promise will be also be rejected if configure has not been called yet.
+Static
setSubscriber attribute associated with the install ad for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the ad subscriber attribute.
+Static
setSubscriber attribute associated with the install ad group for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting ad group.
+Static
setSubscriber attribute associated with the Adjust Id for the user +Required for the RevenueCat Adjust integration
+Adjust ID to use in Adjust integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting Adjust ID.
+Static
setSubscriber attribute associated with the Airship Channel Id for the user +Required for the RevenueCat Airship integration
+Airship Channel ID to use in Airship integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the Airship Channel ID.
+Static
set@deprecated, configure behavior through the RevenueCat dashboard (app.revenuecat.com) instead. +If an user tries to purchase a product that is active on the current app store account, +we will treat it as a restore and alias the new ID with the previous id. +If you have configured the Legacy restore behavior in the RevenueCat dashboard +and are currently setting this to true, keep this setting active.
+Set this to true if you are passing in an appUserID but it is anonymous, +this is true by default if you didn't pass an appUserID
+The promise will be rejected if configure has not been called yet.
+Static
setSubscriber attribute associated with the AppsFlyer Id for the user +Required for the RevenueCat AppsFlyer integration
+Appsflyer ID to use in Appsflyer integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the Appsflyer ID.
+Static
setSubscriber attributes are useful for storing additional, structured information on a user. +Since attributes are writable using a public key they should not be used for +managing secure or sensitive information such as subscription status, coins, etc.
+Key names starting with "$" are reserved names used by RevenueCat. For a full list of key +restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes
+Map of attributes by key. Set the value as an empty string to delete an attribute.
+The promise will be rejected if configure has not been called yet or there's an error +setting the subscriber attributes.
+Static
setSubscriber attribute associated with the install campaign for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the campaign.
+Static
setSubscriber attribute associated with the CleverTap Id for the user +Required for the RevenueCat CleverTap integration
+CleverTap user ID to use in CleverTap integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the CleverTap ID.
+Static
setSubscriber attribute associated with the install ad creative for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the creative subscriber attribute.
+Static
setStatic
setSubscriber attribute associated with the display name for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the display name.
+Static
setSubscriber attribute associated with the email address for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the email.
+Static
setFBAnonymousIDSubscriber attribute associated with the Facebook SDK Anonymous Id for the user +Recommended for the RevenueCat Facebook integration
+Facebook Anonymous ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the Facebook Anonymous ID.
+Static
setSubscriber attribute associated with the Firebase App Instance ID for the user +Required for the RevenueCat Firebase integration
+Firebase App Instance ID to use in Firebase integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the Firebase App Instance ID.
+Static
setSubscriber attribute associated with the install keyword for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the keyword.
+Static
setSet a custom log handler for redirecting logs to your own logging system. +By default, this sends info, warning, and error messages. +If you wish to receive Debug level messages, see [setLogLevel].
+It will get called for each log event. +Use this function to redirect the log to your own logging system
+Static
setUsed to set the log level. Useful for debugging issues with the lovely team @RevenueCat. +The default is {LOG_LEVEL.INFO} in release builds and {LOG_LEVEL.DEBUG} in debug builds.
+Static
setSubscriber attribute associated with the install media source for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the media source.
+Static
setSubscriber attribute associated with the Mixpanel Distinct Id for the user +Required for the RevenueCat Mixpanel integration
+Mixpanel Distinct ID to use in Mixpanel integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the Mixpanel Distinct ID.
+Static
setSubscriber attribute associated with the mParticle Id for the user +Recommended for the RevenueCat mParticle integration
+Mparticle ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the Mparticle ID.
+Static
setSubscriber attribute associated with the OneSignal Player Id for the user +Required for the RevenueCat OneSignal integration
+OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the OneSignal ID.
+Static
setSubscriber attribute associated with the phone number for the user
+Empty String or null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the phone number.
+Static
setStatic
setSubscriber attribute associated with the push token for the user
+null will delete the subscriber attribute.
+The promise will be rejected if configure has not been called yet or if there's an error +setting the push token.
+Static
setiOS only.
+Set this property to true only when testing the ask-to-buy / SCA +purchases flow. More information: http://errors.rev.cat/ask-to-buy
+The promise will be rejected if configure has not been called yet.
+Static
showShows in-app messages available from the App Store or Google Play. You need to disable messages from showing +automatically using [PurchasesConfiguration.shouldShowInAppMessagesAutomatically].
+Note: In iOS, this requires version 16+. In older versions the promise will be resolved successfully +immediately.
+Optional
messageTypes: IN_APP_MESSAGE_TYPE[]An array of message types that the stores can display inside your app. Must be one of + [IN_APP_MESSAGE_TYPE]. By default, is undefined and all message types will be shown.
+The promise will be rejected if configure has not been called yet.
+Static
syncThis method will send a purchase to the RevenueCat backend. This function should only be called if you are +in Amazon observer mode or performing a client side migration of your current users to RevenueCat.
+The receipt IDs are cached if successfully posted so they are not posted more than once.
+Product ID associated to the purchase.
+ReceiptId that represents the Amazon purchase.
+Amazon's userID. This parameter will be ignored when syncing a Google purchase.
+Optional
isoCurrencyCode: null | stringProduct's currency code in ISO 4217 format.
+Optional
price: null | numberProduct's price.
+The promise will be rejected if configure has not been called yet or if there's an error +syncing purchases.
+Static
syncSyncs subscriber attributes and then fetches the configured offerings for this user. This method is intended to +be called when using Targeting Rules with Custom Attributes. Any subscriber attributes should be set before +calling this method to ensure the returned offerings are applied with the latest subscriber attributes.
+Promise of entitlements structure. The promise will be rejected if configure +has not been called yet.
+Static
sync@deprecated, use syncAmazonPurchase instead.
+This method will send a purchase to the RevenueCat backend. This function should only be called if you are +in Amazon observer mode or performing a client side migration of your current users to RevenueCat.
+The receipt IDs are cached if successfully posted so they are not posted more than once.
+Product ID associated to the purchase.
+ReceiptId that represents the Amazon purchase.
+Amazon's userID. This parameter will be ignored when syncing a Google purchase.
+Optional
isoCurrencyCode: null | stringProduct's currency code in ISO 4217 format.
+Optional
price: null | numberProduct's price.
+The promise will be rejected if configure has not been called yet or if there's an error +syncing purchases.
+Static
syncThis method will send all the purchases to the RevenueCat backend. Call this when using your own implementation +for subscriptions anytime a sync is needed, like after a successful purchase.
+The promise will be rejected if configure has not been called yet or if there's an error +syncing purchases.
+This function should only be called if you're not calling purchaseProduct/purchaseStoreProduct/purchasePackage/purchaseSubscriptionOption.
+Enum for billing features. +Currently, these are only relevant for Google Play Android users: +https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
+Purchase/query for in-app items on VR.
+Launch a price change confirmation flow.
+Purchase/query for subscriptions.
+Purchase/query for subscriptions on VR.
+Subscriptions update/replace.
+Enum indicating possible eligibility status for introductory pricing.
+The user is eligible for a free trial or intro pricing for this product.
+The user is not eligible for a free trial or intro pricing for this product.
+There is no free trial or intro pricing for this product.
+RevenueCat doesn't have enough information to determine eligibility.
+Payment mode for offer pricing phases. Google Play only.
+Subscribers pay a discounted amount for a specified number of periods
+Subscribers don't pay until the specified period ends
+Subscribers pay up front for a specified period
+Enum indicating possible package types.
+A package configured with the predefined annual identifier.
+A package that was defined with a custom identifier.
+A package configured with the predefined lifetime identifier.
+A package configured with the predefined monthly identifier.
+A package configured with the predefined six month identifier.
+A package configured with the predefined three month identifier.
+A package configured with the predefined two month identifier.
+A package that was defined with a custom identifier.
+A package configured with the predefined weekly identifier.
+Enum indicating possible product categories.
+A type of product for non-subscription.
+A type of product for subscriptions.
+A type of product for unknowns.
+Enum indicating possible product types.
+An auto-renewable subscription.
+A consumable in-app purchase.
+A non-consumable in-app purchase. Only applies to Apple Store products.
+A non-renewing subscription. Only applies to Apple Store products.
+A subscription that is pre-paid. Only applies to Google Play products.
+Unable to determine product type.
+Enum with possible proration modes in a subscription upgrade or downgrade in the Play Store. Used only for Google.
+Replacement takes effect when the old plan expires, and the new price will +be charged at the same time.
+Replacement takes effect immediately, and the user is charged full price +of new plan and is given a full billing cycle of subscription, +plus remaining prorated time from the old plan.
+Replacement takes effect immediately, and the billing cycle remains the +same. The price for the remaining period will be charged. This option is +only available for subscription upgrade.
+Replacement takes effect immediately, and the new price will be charged on +next recurrence time. The billing cycle stays the same.
+Replacement takes effect immediately, and the remaining time will be +prorated and credited to the user. This is the current default behavior.
+Modes for completing the purchase process.
+RevenueCat will not automatically acknowledge any purchases. You will have to do so manually.
+Note: failing to acknowledge a purchase within 3 days will lead to Google Play automatically issuing a +refund to the user.
+For more info, see revenuecat.com.
+RevenueCat will automatically acknowledge verified purchases. No action is required by you.
+Error codes indicating the reason for an error.
+Recurrence mode for a pricing phase
+Pricing phase repeats for a fixed number of billing periods
+Pricing phase repeats infinitely until cancellation
+Pricing phase does not repeat
+Enum for possible refund request results.
+There was an error with the request. See message for more details.
+Apple has received the refund request.
+User canceled submission of the refund request.
+Defines which version of StoreKit may be used
+Let RevenueCat use the most appropriate version of StoreKit
+Always use StoreKit 1.
+Always use StoreKit 2 (StoreKit 1 will be used if StoreKit 2 is not available in the current device.)
+RevenueCat is a powerful, reliable, and free to use in-app purchase server with cross-platform support. Our open-source framework provides a backend and a wrapper around StoreKit and Google Play Billing to make implementing in-app purchases and subscriptions easy.
+Whether you are building a new app or already have millions of customers, you can use RevenueCat to:
+Sign up to get started for free.
+React Native Purchases is the client for the RevenueCat subscription and purchase tracking system. It is an open source framework that provides a wrapper around StoreKit
, Google Play Billing
and the RevenueCat backend to make implementing in-app purchases in React Native
easy.
+ | RevenueCat | +
---|---|
✅ | +Server-side receipt validation | +
➡️ | +Webhooks - enhanced server-to-server communication with events for purchases, renewals, cancellations, and more | +
🎯 | +Subscription status tracking - know whether a user is subscribed whether they're on iOS, Android or web | +
📊 | +Analytics - automatic calculation of metrics like conversion, mrr, and churn | +
📝 | +Online documentation and SDK reference up to date | +
🔀 | +Integrations - over a dozen integrations to easily send purchase data where you need it | +
💯 | +Well maintained - frequent releases | +
📮 | +Great support - Help Center | +
For more detailed information, you can view our complete documentation at docs.revenuecat.com.
+Please follow the Quickstart Guide for more information on how to install the SDK.
+Or view our React Native sample app:
+The minimum React Native version this SDK requires is 0.64
.
Our full SDK reference can be found here.
+Expo supports in-app payments and is compatible with react-native-purchases. To use the library, create a new project and set up a development build. A development build helps you iterate quickly and provides a complete development environment. After you've created the project, install the library:
+$ npx expo install react-native-purchases
+
+If you are using bare workflow (that is, your project is created using react-native init
), install expo
into your project and leverage Expo CLI to use Expo tooling and services.
Type containing all information regarding the customer
+Readonly
activeSet of active subscription skus
+Readonly
allMap of skus to expiration dates
+Readonly
allMap of skus to purchase dates
+Readonly
allSet of purchased skus, active and inactive
+Readonly
entitlementsEntitlements attached to this customer info
+Readonly
firstThe date this user was first seen in RevenueCat.
+Readonly
latestThe latest expiration date of all purchased skus
+Readonly
managementURLURL to manage the active subscription of the user. If this user has an active iOS +subscription, this will point to the App Store, if the user has an active Play Store subscription +it will point there. If there are no active subscriptions it will be null. +If there are multiple for different platforms, it will point to the device store.
+Readonly
nonList of all non subscription transactions. Use this to fetch the history of +non-subscription purchases
+Readonly
originalThe original App User Id recorded for this user.
+Readonly
originalReturns the version number for the version of the application when the +user bought the app. Use this for grandfathering users when migrating +to subscriptions.
+This corresponds to the value of CFBundleVersion (in iOS) in the +Info.plist file when the purchase was originally made. This is always null +in Android
+Readonly
originalReturns the purchase date for the version of the application when the user bought the app. +Use this for grandfathering users when migrating to subscriptions.
+Readonly
requestDate when this info was requested
+Holds the information used when upgrading from another sku. For Android use only.
+Readonly
oldThe old product identifier to upgrade from.
+Optional
Readonly
prorationThe [PRORATION_MODE] to use when upgrading the given oldSKU.
+Type containing information of installment subscriptions. Currently only supported in Google Play.
+Readonly
commitmentNumber of payments the customer commits to in order to purchase the subscription.
+Readonly
renewalAfter the commitment payments are complete, the number of payments the user commits to upon a renewal.
+Contains all the details associated with a Period
+Readonly
iso8601Specified in ISO 8601 format. For example, P1W equates to one week, +P1M equates to one month, P3M equates to three months, P6M equates to six months, +and P1Y equates to one year
+Readonly
unitThe number of period units: day, week, month, year, unknown
+Readonly
valueThe increment of time that a subscription period is specified in
+Contains data about the context in which an offering was presented.
+Readonly
offeringThe identifier of the offering used to obtain this object.
+Readonly
placementThe identifier of the placement used to obtain this object.
+Readonly
targetingThe revision of the targeting used to obtain this object.
+Contains data about the context in which an offering was presented.
+Readonly
revisionThe revision of the targeting used to obtain this object.
+Readonly
ruleThe rule id from the targeting used to obtain this object.
+Contains all the details associated with a Price
+Readonly
amountPrice in micro-units, where 1,000,000 micro-units equal one unit of the currency.
+For example, if price is "€7.99", price_amount_micros is 7,990,000. This value represents +the localized, rounded price for a particular currency.
+Readonly
currencyReturns ISO 4217 currency code for price and original price.
+For example, if price is specified in British pounds sterling, price_currency_code is "GBP". +If currency code cannot be determined, currency symbol is returned.
+Readonly
formattedFormatted price of the item, including its currency sign. For example $3.00
+Contains all the details associated with a PricingPhase
+Readonly
billingNumber of cycles for which the pricing phase applies. +Null for infiniteRecurring or finiteRecurring recurrence modes.
+Readonly
billingBilling period for which the PricingPhase applies
+Readonly
offerIndicates how the pricing phase is charged for finiteRecurring pricing phases
+Readonly
pricePrice of the PricingPhase
+Readonly
recurrenceRecurrence mode of the PricingPhase
+Holds parameters to initialize the SDK.
+RevenueCat API Key. Needs to be a string
+Optional
appA unique id for identifying the user
+Optional
entitlementVerification strictness levels for [EntitlementInfo]. +See https://rev.cat/trusted-entitlements for more info.
+Optional
pendingEnable 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.
+Optional
purchasesSet 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.
+Optional
shouldWhether 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
+Optional
storeiOS-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.
+Optional
useAn optional boolean. Android only. Required to configure the plugin to be used in the Amazon Appstore.
+Optional
userAn 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.
+The EntitlementInfo object gives you access to all of the information about the status of a user entitlement.
+Readonly
billingThe date a billing issue was detected in ISO8601 format. Can be null
if there is no billing issue or an
+issue has been resolved
Entitlement may still be active even if there is a billing issue. Check the isActive
property.
Readonly
billingThe date a billing issue was detected in milliseconds. Can be null
if there is no billing issue or an
+issue has been resolved
Entitlement may still be active even if there is a billing issue. Check the isActive
property.
Readonly
expirationThe expiration date for the entitlement in ISO8601, can be null
for lifetime access.
+If the periodType
is trial
, this is the trial expiration date.
Readonly
expirationThe expiration date for the entitlement in milliseconds, can be null
for lifetime access.
+If the periodType
is trial
, this is the trial expiration date.
Readonly
identifierThe entitlement identifier configured in the RevenueCat dashboard
+Readonly
isTrue if the user has access to this entitlement
+Readonly
isFalse if this entitlement is unlocked via a production purchase
+Readonly
latestThe latest purchase or renewal date for the entitlement in ISO8601 format.
+Readonly
latestThe latest purchase or renewal date for the entitlement in milliseconds.
+Readonly
originalThe first date this entitlement was purchased in ISO8601 format.
+Readonly
originalThe first date this entitlement was purchased in milliseconds.
+Readonly
ownershipSupported ownership types for an entitlement. +PURCHASED if the purchase was made directly by this user. +FAMILY_SHARED if the purchase has been shared to this user by a family member. +UNKNOWN if the purchase has no or an unknown ownership type.
+Readonly
periodThe last period type this entitlement was in. Either: NORMAL, INTRO, TRIAL.
+Readonly
productThe product identifier that unlocked this entitlement
+Readonly
productThe product plan identifier that unlocked this entitlement. Android subscriptions only, null on consumables and iOS.
+Readonly
storeThe store where this entitlement was unlocked from.
+Readonly
unsubscribeThe date an unsubscribe was detected in ISO8601 format. Can be null
.
Entitlement may still be active even if user has unsubscribed. Check the isActive
property.
Readonly
unsubscribeThe date an unsubscribe was detected in milliseconds. Can be null
.
Entitlement may still be active even if user has unsubscribed. Check the isActive
property.
Readonly
verificationIf entitlement verification was enabled, the result of that verification. If not, VerificationResult.NOT_REQUESTED
+Readonly
willTrue if the underlying subscription is set to renew at the end of the billing period (expirationDate).
+Contains all the entitlements associated to the user.
+Readonly
activeMap of active EntitlementInfo (PurchasesEntitlementInfo
) objects keyed by entitlement identifier.
Readonly
allMap of all EntitlementInfo (PurchasesEntitlementInfo
) objects (active and inactive) keyed by entitlement identifier.
Readonly
verificationIf entitlement verification was enabled, the result of that verification. If not, VerificationResult.NOT_REQUESTED
+Type encapsulating an error in an SDK operation.
+access readableErrorCode through userInfo.readableErrorCode
+use code === Purchases.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR instead
+Contains information about the introductory price for a product
+Readonly
cyclesNumber of subscription billing periods for which the user will be given the discount, such as 3.
+Readonly
periodBilling period of the discount, specified in ISO 8601 format.
+Readonly
periodNumber of units for the billing period of the discount.
+Readonly
periodUnit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR.
+Readonly
pricePrice in the local currency.
+Readonly
priceFormatted price, including its currency sign, such as €3.99.
+An offering is a collection of Packages (PurchasesPackage
) available for the user to purchase.
+For more info see https://docs.revenuecat.com/docs/entitlements
Readonly
annualAnnual package type configured in the RevenueCat dashboard, if available.
+Readonly
availableArray of Package
objects available for purchase.
Readonly
identifierUnique identifier defined in RevenueCat dashboard.
+Readonly
lifetimeLifetime package type configured in the RevenueCat dashboard, if available.
+Readonly
metadataOffering metadata defined in RevenueCat dashboard. To access values, you need +to check the type beforehand. For example: +const my_unknown_value: unknown = offering.metadata['my_key']; +const my_string_value: string | undefined = typeof(my_unknown_value) === 'string' ? my_unknown_value : undefined;
+Readonly
monthlyMonthly package type configured in the RevenueCat dashboard, if available.
+Readonly
serverOffering description defined in RevenueCat dashboard.
+Readonly
sixSix month package type configured in the RevenueCat dashboard, if available.
+Readonly
threeThree month package type configured in the RevenueCat dashboard, if available.
+Readonly
twoTwo month package type configured in the RevenueCat dashboard, if available.
+Readonly
weeklyWeekly package type configured in the RevenueCat dashboard, if available.
+Contains all the offerings configured in RevenueCat dashboard. +For more info see https://docs.revenuecat.com/docs/entitlements
+Readonly
allMap of all Offerings [PurchasesOffering] objects keyed by their identifier.
+Readonly
currentCurrent offering configured in the RevenueCat dashboard.
+Contains information about the product available for the user to purchase. +For more info see https://docs.revenuecat.com/docs/entitlements
+Readonly
identifierUnique identifier for this package. Can be one a predefined package type or a custom one.
+Readonly
offeringOffering this package belongs to.
+Use presentedOfferingContext
+Readonly
packagePackage type for the product. Will be one of [PACKAGE_TYPE].
+Readonly
presentedOffering context this package belongs to. +Null if not using offerings or if fetched directly from store via getProducts.
+Readonly
productProduct assigned to this package.
+Holds the information about a PromotionalOffer in Apple's App Store.
+Readonly
identifierReadonly
keyReadonly
nonceReadonly
signatureReadonly
timestampType representing a product from the Store.
+Readonly
currencyCurrency code for price and original price. +Contains the currency code value of defaultOption for Google Play.
+Readonly
defaultDefault subscription option for a product. Google Play only.
+Readonly
descriptionDescription of the product.
+Readonly
discountsCollection of discount offers for a product. Null for Android.
+Readonly
identifierProduct Id.
+Readonly
introIntroductory price.
+Readonly
presentedOffering context this package belongs to. +Null if not using offerings or if fetched directly from store via getProducts.
+Readonly
presentedOffering identifier the store product was presented from. +Null if not using offerings or if fetched directly from store via getProducts.
+Use presentedOfferingContext
+Readonly
pricePrice of the product in the local currency. +Contains the price value of defaultOption for Google Play.
+Readonly
priceNull for INAPP products. The price of the PurchasesStoreProduct in a monthly recurrence. +This means that, for example, if the period is annual, the price will be +divided by 12. Note that this value may be an approximation. For Google subscriptions, +this value will use the basePlan to calculate the value.
+Readonly
priceNull for INAPP products. The price of the PurchasesStoreProduct formatted for the current +locale in a monthly recurrence. This means that, for example, if the period is annual, +the price will be divided by 12. It uses a currency formatter to format the price in the +given locale. Note that this value may be an approximation. For Google subscriptions, +this value will use the basePlan to calculate the value.
+Readonly
priceNull for INAPP products. The price of the PurchasesStoreProduct in a weekly recurrence. +This means that, for example, if the period is monthly, the price will be +divided by 4. Note that this value may be an approximation. For Google subscriptions, +this value will use the basePlan to calculate the value.
+Readonly
priceNull for INAPP products. The price of the PurchasesStoreProduct formatted for the current +locale in a weekly recurrence. This means that, for example, if the period is monthly, +the price will be divided by 4. It uses a currency formatter to format the price in the +given locale. Note that this value may be an approximation. For Google subscriptions, +this value will use the basePlan to calculate the value.
+Readonly
priceNull for INAPP products. The price of the PurchasesStoreProduct in a yearly recurrence. +This means that, for example, if the period is monthly, the price will be multiplied by +12. Note that this value may be an approximation. For Google subscriptions, this value +will use the basePlan to calculate the value.
+Readonly
priceNull for INAPP products. The price of the PurchasesStoreProduct formatted for the current +locale in a yearly recurrence. This means that, for example, if the period is monthly, +the price will be multiplied by 12. It uses a currency formatter to format the price in the +given locale. Note that this value may be an approximation. For Google subscriptions, +this value will use the basePlan to calculate the value.
+Readonly
priceFormatted price of the item, including its currency sign. +Contains the formatted price value of defaultOption for Google Play.
+Readonly
productProduct category.
+Readonly
productThe specific type of subscription or one time purchase this product represents. +Important: In iOS, if using StoreKit 1, we cannot determine the type.
+Readonly
subscriptionCollection of subscription options for a product. Google Play only.
+Readonly
subscriptionSubscription period, specified in ISO 8601 format. For example, +P1W equates to one week, P1M equates to one month, +P3M equates to three months, P6M equates to six months, +and P1Y equates to one year. +Note: Not available for Amazon.
+Readonly
titleTitle of the product.
+Contains information about a discount offer for a product
+Readonly
cyclesNumber of subscription billing periods for which the user will be given the discount, such as 3.
+Readonly
identifierIdentifier of the discount.
+Readonly
periodBilling period of the discount, specified in ISO 8601 format.
+Readonly
periodNumber of units for the billing period of the discount.
+Readonly
periodUnit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR.
+Readonly
pricePrice in the local currency.
+Readonly
priceFormatted price, including its currency sign, such as €3.99.
+Represents a non-subscription transaction in the Store.
+Product Id associated with the transaction.
+Purchase date of the transaction in ISO 8601 format.
+Id of the transaction.
+Holds the information about a Win-Back Offer in Apple's App Store.
+Readonly
cyclesNumber of subscription billing periods for which the user will be given the discount, such as 3.
+Readonly
identifierIdentifier of the discount.
+Readonly
periodBilling period of the discount, specified in ISO 8601 format.
+Readonly
periodNumber of units for the billing period of the discount.
+Readonly
periodUnit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR.
+Readonly
pricePrice in the local currency.
+Readonly
priceFormatted price, including its currency sign, such as €3.99.
+Contains all details associated with a SubscriptionOption +Used only for Google
+Readonly
billingThe subscription period of fullPricePhase (after free and intro trials).
+Readonly
freeThe free trial PricingPhase of the subscription. +Looks for the first pricing phase of the SubscriptionOption where amountMicros is 0. +There can be a freeTrialPhase and an introductoryPhase in the same SubscriptionOption.
+Readonly
fullThe full price PricingPhase of the subscription. +Looks for the last price phase of the SubscriptionOption.
+Readonly
idIdentifier of the subscription option +If this SubscriptionOption represents a base plan, this will be the basePlanId. +If it represents an offer, it will be basePlanId:offerId
+Readonly
installmentsFor installment subscriptions, the details of the installment plan the customer commits to. +Null for non-installment subscriptions. +Installment plans are only available for Google Play subscriptions.
+Readonly
introThe intro trial PricingPhase of the subscription. +Looks for the first pricing phase of the SubscriptionOption where amountMicros is greater than 0. +There can be a freeTrialPhase and an introductoryPhase in the same SubscriptionOption.
+Readonly
isTrue if this SubscriptionOption represents a subscription base plan (rather than an offer).
+Readonly
isTrue if the subscription is pre-paid.
+Readonly
presentedOffering context this package belongs to. +Null if not using offerings or if fetched directly from store via getProducts.
+Readonly
presentedOffering identifier the subscription option was presented from
+Use presentedOfferingContext
+Readonly
pricingPricing phases defining a user's payment plan for the product over time.
+Readonly
productIdentifer of the subscription associated with this SubscriptionOption +This will be subId
+Readonly
storeIdentifier of the StoreProduct associated with this SubscriptionOption +This will be subId:basePlanId
+Readonly
tagsTags defined on the base plan or offer. Empty for Amazon.
+Holds the information used when upgrading from another sku. For Android use only.
+Use GoogleProductChangeInfo
+Readonly
oldSKUThe oldSKU to upgrade from.
+Optional
Readonly
prorationThe [PRORATION_MODE] to use when upgrading the given oldSKU.
+Listener used on updated customer info
+Object containing info for the customer
+Listener used to receive log messages from the SDK.
+Result of a successful purchase
+The Customer Info for the user.
+The product identifier of the purchased product
+The transaction object for the purchase
+Allows you to specify whether you want RevenueCat to complete your app's purchases +or if your app will do so.
+You can configure RevenueCat to complete your purchases like so:
+Purchases.configure({
apiKey: "123",
purchasesAreCompletedBy: PURCHASES_ARE_COMPLETED_BY.REVENUECAT,
});
+
+You can specify that purchase are completed by your app like so:
+Purchases.configure({
apiKey: "123",
purchasesAreCompletedBy: {
type: PURCHASES_ARE_COMPLETED_BY.MY_APP,
storeKitVersion: STOREKIT_VERSION.STOREKIT_1
},
});
+
+Configuration option that specifies that your app will complete purchases.
+The version of StoreKit that your app is using to make purchases. This value is ignored +on Android, so if your app is Android-only, you may provide any value.
+Listener used to determine if a user should be able to purchase a promo product.
+
Enum for billing features. +Currently, these are only relevant for Google Play Android users: +https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
+