
Add native mobile monetization to my app using the Despia SDK from: https://www.npmjs.com/package/despia-native
First, install the package: npm install despia-native
Then import it: import despia from 'despia-native'
Create a payment system that uses RevenueCat URLs like: despia("revenuecat://purchase?external_id={USER_ID}&product={PRODUCT_ID}")
to handle purchases through Apple App Store and Google Play billing.
This feature requires native capabilities which will be fully provided by the “despia-native” npm package, no additional native libraries are needed!
Add buttons for different subscription tiers of my app:
e.g. "monthly_basic", "lifetime"
Payment confirmation will happen via RevenueCat's Webhooks, so make sure to include or instruct me to set up the correct backend structure.
You can find the documentation about this here: https://www.revenuecat.com/docs/integrations/webhooks
Once the payment is confirmed on the backend, the backend should send a webhook to the frontend to let it know that this user's in-app purchase session was completed.
Please follow the installation instructions for the "despia-native" npm package closely, and do not modify my instructions. Implementation as mentioned is critical.
How it works: Despia acts as a bridge between your Lovable app and native mobile payment systems. When users tap a purchase button, Despia processes the payment through Apple's App Store or Google Play Store using RevenueCat's infrastructure, ensuring secure transactions and automatic subscription management.
Installation
Install the Despia package from NPM:
npm install despia-native
Usage
1. Import the SDK
import despia from 'despia-native';
2. Execute Payment
Call the despia()
function with a RevenueCat Command:
despia("revenuecat://purchase?external_id=user_777&product=monthly_premium");
Resources
-
View full NPM documentation for additional configuration options
Lovable Integration
This SDK is optimized for Lovable's prompt-based AI builder, enabling quick integration of native mobile payments into your generated apps.
For additional support or questions, please contact our support team at support@despia.com