RevenueCat integration
Sync in-app purchase and subscription events from RevenueCat into OnRamp to see App Store and Play Store revenue alongside your onboarding funnel.
What gets synced
RevenueCat delivers events via webhook in real time. The following event types are supported:
| RevenueCat event | OnRamp event type |
|---|---|
INITIAL_PURCHASE | subscription_started |
RENEWAL | subscription_renewed |
CANCELLATION | subscription_canceled |
EXPIRATION | subscription_expired |
TRIAL_STARTED | trial_started |
TRIAL_CONVERTED | trial_converted |
REFUND | refund (amount stored as negative) |
Revenue amounts, currency, product identifier, and store (App Store / Play Store) are stored with each event.
Connect
- Go to Settings → Integrations → Add integration → RevenueCat
- Paste your RevenueCat Secret API key (found in RevenueCat → Project Settings → API Keys)
- Choose an identity strategy -
anonymous_idis strongly recommended (see below) - Click Connect
- Copy the webhook URL shown after connecting and add it in RevenueCat (see below)
Identity strategy
Recommended - anonymous_id (direct match)
Set your RevenueCat appUserID to the OnRamp anonymous_id. This is the cleanest setup - no email matching or property lookups needed.
React Native / Expo:
import { useOnRamp } from '@onramp-sdk/react-native'
import Purchases from 'react-native-purchases'
const { anonymousId } = useOnRamp()
await Purchases.configure({
apiKey: 'your_revenuecat_api_key',
appUserID: anonymousId,
})
iOS (Swift):
let anonymousId = OnRamp.shared.anonymousId
Purchases.configure(withAPIKey: "your_api_key", appUserID: anonymousId)
Android (Kotlin):
val anonymousId = OnRamp.anonymousId
Purchases.configure(PurchasesConfiguration.Builder(context, "your_api_key")
.appUserID(anonymousId)
.build())
Call Purchases.configure after initialising the OnRamp SDK so the anonymous_id is available. OnRamp persists the same ID across app launches (up to 365 days).
Alternative - email match via identify()
If you can't change the RevenueCat appUserID, call OnRamp.identify() after sign-in instead:
// React Native / Expo
OnRamp.identify({ email: user.email })
// React / Next.js
const { identify } = useOnRamp()
identify({ email: user.email })
Select Identity strategy: email when connecting. OnRamp matches RevenueCat subscriber emails against traits from your identify() calls.
Configure the webhook
RevenueCat pushes events to your endpoint. You must configure this for the integration to receive data.
- In RevenueCat, go to Project Settings → Integrations → Webhooks
- Click Add webhook
- Set the Endpoint URL to:
Your integration ID is shown in OnRamp → Settings → Integrations after connecting.
https://your-domain.com/api/integrations/webhooks/revenuecat?integration_id=<your-integration-id> - Optionally set an Authorization header value - paste the same value into the Webhook secret field in the OnRamp integration settings
RevenueCat sends a test event when you save the webhook. OnRamp will receive it but ignore it (test events use a dummy app_user_id that won't resolve to a real anonymous_id).
Backfill
Unlike Stripe, RevenueCat does not provide a bulk subscriber list API on all plans. Historical data before the webhook was set up will not be automatically backfilled. For a full backfill, contact RevenueCat support to request a data export, then reach out to OnRamp support to import it.
Troubleshooting
No events appearing - confirm the webhook URL is saved in RevenueCat and includes the correct integration_id query parameter.
"Invalid RevenueCat webhook secret" - the Authorization header value sent by RevenueCat must match the Webhook secret you saved in OnRamp. Check both match exactly.
Users not resolving - if using the anonymous_id strategy, verify that Purchases.configure is called with the OnRamp anonymous_id and not your own user ID. Log both values during development to confirm.
