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 eventOnRamp event type
INITIAL_PURCHASEsubscription_started
RENEWALsubscription_renewed
CANCELLATIONsubscription_canceled
EXPIRATIONsubscription_expired
TRIAL_STARTEDtrial_started
TRIAL_CONVERTEDtrial_converted
REFUNDrefund (amount stored as negative)

Revenue amounts, currency, product identifier, and store (App Store / Play Store) are stored with each event.


Connect

  1. Go to Settings → Integrations → Add integration → RevenueCat
  2. Paste your RevenueCat Secret API key (found in RevenueCat → Project Settings → API Keys)
  3. Choose an identity strategy - anonymous_id is strongly recommended (see below)
  4. Click Connect
  5. 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:

javascript
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):

swift
let anonymousId = OnRamp.shared.anonymousId
Purchases.configure(withAPIKey: "your_api_key", appUserID: anonymousId)

Android (Kotlin):

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:

javascript
// 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.

  1. In RevenueCat, go to Project Settings → Integrations → Webhooks
  2. Click Add webhook
  3. Set the Endpoint URL to:
    https://your-domain.com/api/integrations/webhooks/revenuecat?integration_id=<your-integration-id>
    
    Your integration ID is shown in OnRamp → Settings → Integrations after connecting.
  4. 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.