Skip to content
Docs and guides

Help Center

Step-by-step guides for every setting in App Studio.

RevenueCat

Updated

Subscriptions and paywalls across iOS and Android.

Enable a native plugin, configure its settings, then rebuild and install the app.
Native plugin changes require a new build. Follow this guide for the exact settings and supported methods.View full size
  • JavaScript: window.AppSorcerer.revenuecat
  • Plan: Business (premium) — included on plans with premium plugins, and you can try it free for 14 days
  • Platforms: Android apps today. iOS support arrives with iOS builds (coming soon).

Turn the plugin on in App Studio → Plugins, fill in its settings, then rebuild your app. Websites call it through the JavaScript bridge.

Settings

Studio labelTypeDefaultNotes
Google Play public SDK keytext–required
App Store public SDK keytext–

Setup

Enter the Google Play public SDK key (goog_…, from RevenueCat → Project → API keys). Set up products, entitlements and offerings in RevenueCat and Play Console. Don't turn on the In-App Purchases plugin for the same products.

JavaScript API

Every method returns a Promise. Call it as await AppSorcerer.revenuecat.<method>(args).

MethodArgumentsResolves with
getOfferings–{ current, all: { [id]: offering } } — offering: { identifier, serverDescription, metadata, availablePackages: [{ identifier, packageType, offeringIdentifier, product }] }, product: { identifier, title, name, description, price, priceString, priceAmountMicros, currencyCode, period, type }
purchasePackage{ packageId, offeringId? }{ customerInfo, transaction }
purchaseProduct{ productId }{ customerInfo, transaction }
restorePurchases–{ customerInfo }
getCustomerInfo–customerInfo: { originalAppUserId, activeSubscriptions, allPurchasedProductIds, latestExpirationDate, firstSeen, requestDate, managementURL, entitlements: { active, all } }
logIn{ appUserId }{ customerInfo, created }
logOut–{ customerInfo }
getAppUserId–{ appUserId, isAnonymous }
setAttributes{ attributes: {} }null
setEmail / setDisplayName / setPhoneNumber{ email } / { displayName } / { phoneNumber }null
syncPurchases–{ customerInfo }

Entitlement: { identifier, isActive, willRenew, periodType, productIdentifier, store, isSandbox, latestPurchaseDate, originalPurchaseDate, expirationDate, unsubscribeDetectedAt, billingIssueDetectedAt }. Dates are ISO 8601 strings.

Events

Listen with AppSorcerer.on('<event>', callback) (or the DOM event appsorcerer:<event>).

EventData
revenuecat.customerInfocustomerInfo, whenever RevenueCat reports a change

Errors

Rejections carry error.code: canceled, purchases_<code> (RevenueCat error code, e.g. purchases_network_error), not_found, not_configured, invalid_args, unavailable, unknown_method.

Example

JavaScript
const { current } = await AppSorcerer.revenuecat.getOfferings();
const monthly = current.availablePackages.find((p) => p.packageType === 'MONTHLY');
const { customerInfo } = await AppSorcerer.revenuecat.purchasePackage({ packageId: monthly.identifier });
const isPro = 'pro' in customerInfo.entitlements.active;

Notes

  • RevenueCat and In-App Purchases can both be in one app as long as they handle different products.
Was this helpful?