Revenuecat Setup
RevenueCat Setup Guide
Overview
RevenueCat manages in-app purchases and subscriptions for Civix across iOS and Android.
Step 1: Create RevenueCat Account
- Go to https://app.revenuecat.com
- Sign up with email or GitHub
- Verify your email
Step 2: Create a New Project
- Click "Create New Project"
- Name:
CivixorUS Civics Test - Save the project
Step 3: Add iOS App
- In your project, click "Apps" → "Add App"
- Select "Apple App Store"
- Enter:
- App Name:
Civix - Bundle ID:
com.civics.test
- App Name:
- Get your iOS API Key (Public SDK Key)
- Save it - you'll need it for
lib/purchases.ts
Connect to App Store Connect
- In RevenueCat, go to your iOS app → "App Store Connect API"
- Follow the guide to create an API key in App Store Connect:
- Go to https://appstoreconnect.apple.com/access/api
- Click "Generate API Key"
- Name:
RevenueCat - Access:
AdminorDeveloper - Download the
.p8file
- Enter in RevenueCat:
- Issuer ID: From App Store Connect
- Key ID: From App Store Connect
- Upload the
.p8file
Step 4: Add Android App
- Click "Add App" → "Google Play Store"
- Enter:
- App Name:
Civix - Package Name:
com.civics.test
- App Name:
- Get your Android API Key (Public SDK Key)
Connect to Google Play Console
- In Google Play Console, go to "Setup" → "API Access"
- Create a new service account
- Grant "Admin" access
- Download the JSON credentials file
- Upload to RevenueCat
Step 5: Create Products in RevenueCat
Entitlements
- Go to "Entitlements" → "Create New"
- Create:
premium- This is what the app checks for premium access
Products
- Go to "Products" → "Create New"
- Create these products:
| Product ID | Type | Platform |
|---|---|---|
civix_monthly | Auto-Renewable Subscription | iOS & Android |
civix_annual | Auto-Renewable Subscription | iOS & Android |
civix_lifetime | Non-Consumable | iOS & Android |
- Link each product to the
premiumentitlement
Offerings
- Go to "Offerings" → "Create New"
- Name:
default - Add packages:
$rc_monthly→civix_monthly$rc_annual→civix_annual$rc_lifetime→civix_lifetime
Step 6: Update App Code
Edit /lib/purchases.ts:
// Replace these with your actual API keys
const REVENUECAT_IOS_KEY = "appl_YOUR_IOS_KEY_HERE";
const REVENUECAT_ANDROID_KEY = "goog_YOUR_ANDROID_KEY_HERE";
Step 7: Testing
iOS Sandbox Testing
- Create a Sandbox Tester in App Store Connect
- Sign out of App Store on device
- When prompted during purchase, use sandbox credentials
- Subscriptions renew every 5 minutes in sandbox
Android Test Accounts
- In Play Console, add license testers
- Use those Google accounts on test devices
- Test purchases will be free
RevenueCat Dashboard
- Monitor purchases in real-time
- Check "Customers" to see test transactions
- Use "Debug" mode to verify SDK integration
Checklist
- RevenueCat account created
- iOS app added with API key
- Android app added with API key
- App Store Connect API connected
- Google Play API connected
-
premiumentitlement created - 3 products created (monthly, annual, lifetime)
- Default offering configured
- API keys updated in
lib/purchases.ts - Sandbox testing completed on iOS
- Test purchases completed on Android