Docs
Handling purchases
Wire Onvert paywall CTAs to your existing StoreKit or Play Billing path.
Onvert does not replace your billing stack. When a user taps a plan on a paywall, the SDK calls your onPurchase handler with a product identifier you configured in the dashboard.
Recommended pattern
- Map dashboard product IDs to App Store / Play product IDs one-to-one
- Start the store purchase inside onPurchase
- On success, unlock entitlements in your app and let the flow continue / complete
- On failure or cancel, keep the paywall visible so the user can retry
tsx
onPurchase={async (productId) => {
const result = await iap.purchase(productId);
if (!result.ok) throw new Error(result.message);
}}Throwing or rejecting from onPurchase signals a failed purchase so the SDK can keep the paywall open.