RevenueCat Integration
RevenueCat provides a backend and a wrapper around StoreKit and Google Play Billing to make implementing in-app purchases and subscriptions easy.
Setup
- Create an account at RevenueCat.
- Create a new project and add your app (iOS and Android).
- Get your API keys from the dashboard.
Configuration
RevenueCat API keys are configured in your app.json file under the extra field.
These values are embedded at build time and accessed via Expo's Constants API.
app.json
{
"expo": {
"extra": {
"revenueCat": {
"iosKey": "your_ios_api_key_here",
"androidKey": "your_android_api_key_here"
}
}
}
}Platform-Specific Keys
RevenueCat requires separate API keys for iOS and Android. Make sure to get both keys from your RevenueCat dashboard.
How It Works
The RevenueCat service reads configuration from app.json at runtime:
import Constants from 'expo-constants';
const IOS_KEY = Constants.expoConfig?.extra?.revenueCat?.iosKey;
const ANDROID_KEY = Constants.expoConfig?.extra?.revenueCat?.androidKey;Adjust Integration
When both RevenueCat and Adjust are enabled, the SDK initializer automatically shares Adjust's advertising ID (ADID) with RevenueCat for attribution:
// After Adjust initializes
const adid = await adjustService.getAdid();
if (adid) {
Purchases.setAdjustID(adid);
}