Native iOS and Android billing fully bridged to your web layer. Trigger purchases, display native paywalls, and check entitlements from your web app usingDocumentation Index
Fetch the complete documentation index at: https://setup.despia.com/llms.txt
Use this file to discover all available pages before exploring further.
despia(), with no native code and no native billing SDK to configure.
Installation
- Bundle
- CDN
RevenueCat and Despia setup
Configure RevenueCat, then connect it to Despia. The steps go in order, each one feeds the next.Create a RevenueCat account
Go to app.revenuecat.com and sign up, or sign in with an existing account. RevenueCat is free up to a monthly tracked revenue threshold, after which a percentage fee applies, so account creation does not block early development.
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.Create an Android app in RevenueCat
Repeat Project settings > Apps > + New and choose Play Store. Enter your Android package name (the same value as your iOS bundle ID for Despia apps) and upload your Google Play Service Account credentials JSON. This lets RevenueCat verify Play Store purchases.
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).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.
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
How it works
Despia bridges your web layer to the native RevenueCat SDK. Purchases go through the App Store or Google Play billing system. When a transaction completes, the runtime fireswindow.onRevenueCatPurchase() in your web layer. You can then check entitlements instantly using getpurchasehistory://, which queries the native store directly with no backend needed.
Reference
All schemes, parameters, response fields, callback behaviour, and webhook setup.
Webhooks
Full backend webhook handler covering all RevenueCat event types.
Entitlement check
Set up entitlements in your RevenueCat dashboard first. Create an entitlement (e.g.premium), then attach both your iOS and Android products to it. Both platforms will return the same entitlementId in the response.
Customer Center
The RevenueCat Customer Center is a native UI where users can restore purchases, manage their subscription, request refunds (iOS only), and submit feedback surveys without leaving your app. Trigger it from your web layer with a single scheme.restoreCompleted. The Customer Center’s restore and the Despia getpurchasehistory:// query both hit the native store, but running both back-to-back guarantees your web layer reflects whatever the device thinks is true, regardless of timing or edge cases.
Google Play does not allow in-app refund requests, so the Customer Center on Android has no refund button and the
refundRequested / refundCompleted events never fire on Android. Configure a custom URL management option in your RevenueCat dashboard to route Android users to your support email or Google Play subscriptions page. See the Reference for the full Android refund fallback pattern.Resources
NPM Package
despia-native
RevenueCat Dashboard
Configure entitlements, offerings, and paywalls
RevenueCat Webhooks
Event types, fields, and sample payloads