Native App Store and Google Play billing in your web app via the Despia SDK and RevenueCat.
Native iOS and Android billing fully bridged to your web layer. Trigger purchases, display native paywalls, and check entitlements from your web app using despia(), with no native code and no native billing SDK to configure.
RevenueCat must be enabled in Despia > App > Settings > Integrations > RevenueCat and your RevenueCat API key configured before any purchases will work.
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 fires window.onRevenueCatPurchase() in your web layer. You can then check entitlements instantly using getpurchasehistory://, which queries the native store directly with no backend needed.
// Check entitlements on load and after every purchaseconst data = await despia('getpurchasehistory://', ['restoredData'])const active = (data.restoredData ?? []).filter(p => p.isActive)if (active.some(p => p.entitlementId === 'premium')) unlockPremium()
For users on the web app who are not in the Despia WebView, fall back to a RevenueCat Web Purchase Link with the user’s ID appended.
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.
// Reuse this function on app load, page navigation, and in onRevenueCatPurchaseasync function checkEntitlements() { const data = await despia('getpurchasehistory://', ['restoredData']) const active = (data.restoredData ?? []).filter(p => p.isActive) if (active.some(p => p.entitlementId === 'premium')) unlockPremium() if (active.some(p => p.entitlementId === 'no_ads')) removeAds()}checkEntitlements()window.onRevenueCatPurchase = checkEntitlements