Skip to main content
Build purchases and subscriptions into your Despia V3 web app with the native RevenueCat bridge. Load store-localized prices, build a custom purchase screen or open a native paywall, identify customers, read entitlement lifecycle state, restore purchases, and present Apple offer-code redemption without adding a native billing library to your web project.

Installation


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
Both values must match exactly what RevenueCat issued.
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.
Changing the website or installing a JavaScript package does not add native bridge commands to an older app binary. Rebuild after enabling RevenueCat, changing its native settings, or adopting these runtime features.

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.
Replace 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.
Use 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:
Pass a product ID returned by the native catalog, including the Android base plan suffix for subscriptions. A successful consumable purchase can have no entitlement. Verify and fulfill consumables on your backend instead of treating an empty entitlement array as a failed transaction. For normal browsers outside Despia, use RevenueCat’s web checkout rather than a native scheme. Keep the same account identity across platforms and verify protected backend access server-side.

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

Use customer.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.