SDKsMonetization
Monetization is your growth multiplier.
This boilerplate uses:
- RevenueCat for purchases/subscriptions (via
react-native-purchases) - Superwall for paywalls + placements (via
expo-superwall)
The integration is already scaffolded—your job is mostly keys + products + dashboards.
Where the code lives
- Purchase + paywall provider:
src/shared/hooks/use-purchase.tsx(wrapsSuperwallProvider, connects to RevenueCat, exposesusePurchase()) - RevenueCat wrapper:
src/shared/libs/revenuecat.ts - Superwall wrapper:
src/shared/libs/superwall.ts - Provider mounting:
src/shared/hooks/providers.tsx - Example:
src/app/(tabs)/profile/index.tsx(capturePlacement('unlock_premium'))
Prerequisites
- Create RevenueCat project: RevenueCat docs
- Create Superwall project: Superwall docs
- iOS app must exist in App Store Connect
- Android app must exist in Google Play Console
1) Environment variables
Add to .env (or EAS secrets):
- RevenueCat:
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY,EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY - Superwall:
EXPO_PUBLIC_SUPERWALL_IOS_API_KEY,EXPO_PUBLIC_SUPERWALL_ANDROID_API_KEY
Missing Superwall keys: app won't crash—
capturePlacement()runs the feature callback directly.
Missing RevenueCat keys: purchases return{ type: 'failed', error: 'RevenueCat not configured' }.
2) RevenueCat setup
2.1 Create store products
iOS (App Store Connect): Create In-App Purchase (usually Auto-Renewable Subscription).
Android (Google Play Console): Create subscription product (base plan + offers) or in-app product.
2.2 Connect stores + import products
In RevenueCat: Add iOS/Android apps, connect App Store/Play Store credentials, import products.
Reference: RevenueCat installation
2.3 Create entitlements
Create an entitlement (e.g., premium) and attach subscription products to it.
2.4 Create an offering
Create an offering (e.g., default) and add packages (monthly/yearly/etc) pointing to store product IDs.
3) Superwall setup
This repo uses the purchase-controller approach (Superwall triggers purchase; RevenueCat completes it).
3.1 Create paywalls
In Superwall: Create paywall, add products (same store product IDs from App Store/Play Console), configure UI/variants/experiments.
3.2 Create placements
A placement is a string identifier (e.g., unlock_premium, onboarding_completed).
tsx
See example in src/app/(tabs)/profile/index.tsx.
3.3 Configure campaigns with placements
1. Create campaign
In Superwall dashboard → Campaigns → Create Campaign → Name it (e.g., "Premium Unlock Campaign")
2. Add placements
In Placements section → Click "+" → Select existing Superwall event (app_launch, session_start, etc.) or type custom name → Click Add Event
Tip: You can add placements on-the-fly by calling
capturePlacement("myNewPlacement")—Superwall auto-adds it.
3. Assign paywall
Select a paywall from dropdown (or create new). This paywall shows when placement matches campaign filters.
4. Configure audience filters (optional)
Control when paywalls show: non-premium users only, holdout groups, filter by user properties/placement parameters, combine conditions with AND/OR logic.
How it works: When capturePlacement("unlock_premium", ...) is called: Superwall checks for campaign → evaluates filters → shows paywall if conditions match → otherwise calls feature callback.
References: Campaigns, Placements, Audiences
4) Manual purchase and restore
tsx
Uses store product IDs (calls
Purchases.getProducts([productId])).
5) Testing checklist
- iOS: Sandbox tester in App Store Connect; validate products load and purchases succeed
- Android: Play Console internal testing; ensure app is signed and products are active
- Verify:
capturePlacement()shows paywall when expected; purchasing updates RevenueCat entitlements;useUserStore().isPremiumupdates; restore works
