Installation
- Bundle
- CDN
RevenueCat and Despia setup
Configure RevenueCat, then connect it to Despia. The steps go in order, each one feeds the next.1
Create a RevenueCat account
Go to app.revenuecat.com and sign up, or sign in with an existing account. Follow RevenueCat’s current account and store setup instructions.
2
Create an iOS app in RevenueCat
In RevenueCat, go to Project settings > Apps > + New and choose App Store. Enter your iOS bundle ID (e.g.
com.despia.myapp), upload a new App Store Connect API key (App Manager), and an in-app purchase key. RevenueCat needs both to validate iOS receipts on your behalf.3
Create an Android app in RevenueCat
Repeat Project settings > Apps > + New and choose Play Store. Enter your Android package name and upload your Google Play Service Account credentials JSON. This lets RevenueCat verify Play Store purchases.
4
Configure entitlements and offerings
In RevenueCat, go to Entitlements > + New and create entitlements that represent the things users unlock, like
premium or no_ads. Then go to Products and import your App Store Connect and Play Console products, attaching each to the matching entitlement. Finally, go to Offerings and group products into offerings that drive your paywalls (e.g. a default offering with monthly and annual packages).5
Get your RevenueCat API keys
Go to Project settings > API keys. Copy the iOS Public SDK Key and the Android Public SDK Key. You will paste both into Despia in the next step.
6
Enable RevenueCat in the Despia Editor
Open the Despia Editor and go to App > Settings > Integrations > RevenueCat. Toggle the integration on, then paste in:
- iOS Public SDK Key
- Android Public SDK Key
7
Rebuild your app
Trigger a fresh build from the Despia Editor. The RevenueCat SDK has to be compiled into the app binary, so this cannot be applied over-the-air. Install the new native build and test purchases with the appropriate App Store or Google Play test account before release.
What you can build
Load prices and customer access
Install your callbacks before sending a command. This example requests the catalog first, then requests the current customer’s entitlements after the catalog arrives, so the two bridge navigations do not replace each other.premium with an entitlement ID configured in your RevenueCat project. Display the returned priceString; never hardcode the price or currency. Read the catalog and offering fields before advertising trials or monthly-equivalent pricing.
Bind your signed-in account
RevenueCat starts with an anonymous App User ID. Once your own authentication succeeds, bind your stable account ID and wait for the response before starting an account-bound purchase.revenuecat://whoami to inspect the current identity and revenuecat://logout when your own user signs out. Bridge 2 also supports purchasing as the current user without external_id, including before signup. RevenueCat’s identity and transfer rules determine how anonymous purchases associate with an existing account. See identity and capability detection.
Purchase or open a paywall
Register one result handler for the native flows your page uses:Redeem codes, restore, and manage subscriptions
On iPhone and iPad,despia('revenuecat://redeem') presents Apple’s offer-code sheet. Its immediate presented result only acknowledges the sheet; check customer entitlements after redemption. Android users redeem Google Play codes through Google Play.
Open despia('revenuecat://center') from your Restore Purchases or Manage Subscription button. onRevenueCatCenter reports restore progress, management selections, feedback, and dismissal. iOS also reports refund-request activity; refund approval remains a server-side event. See the Customer Center reference.
Check access on the client and server
Usecustomer.entitlements.active to update native-app UI, refreshing it when the app opens and after purchases, restores, and account changes. Customer info may come from RevenueCat’s cache, so do not describe it as a guaranteed real-time network verification.
For protected server resources, authenticate the user on your backend and verify the entitlement for that account. Use RevenueCat webhooks for renewals, refunds, billing issues, and changes while the app is closed. Keep secret RevenueCat API keys on the server.
Resources
Reference
Every command, response field, callback, platform difference, and error condition.
Webhooks
Connect RevenueCat lifecycle events to your backend.