RevenueCat Integration
Connect RevenueCat via OAuth and sync subscription metrics.
Setup
Connection is via OAuth, initiated from the project's Revenue layer settings:
- Install the Revenue layer on the project.
- In layer settings, click Connect RevenueCat.
- You're redirected to RevenueCat's OAuth consent screen. Approve the requested scopes.
- On callback, Layers lists your RevenueCat projects. Pick the one to bind to this Layers project.
- The OAuth access + refresh tokens are stored in the
Layers credential vault. The account shows up
as a
revenuecat_accountsrow linked to the project.
Token rotation
RevenueCat access tokens are refreshed automatically on a short cadence. If a token can't be refreshed (revoked, scope change), the integration is marked unhealthy and the sync is skipped until reconnected.
What gets synced
An hourly sync runs per account and calls RevenueCat's metrics APIs. The following is captured:
- MRR, ARR, active subscribers, active trials.
- Churn rate, conversion rate, refund rate.
- LTV (subset — RevenueCat-sourced portion).
- Revenue and subscriber counts per product.
- 7-day and 30-day revenue and new-subscriber totals.
Webhooks
Layers exposes POST /api/webhooks/revenuecat for real-time
subscription-lifecycle events. The endpoint is authenticated via a
bearer token that matches a per-project webhook secret stored in
Vault. Events are written to revenue_events.
Configure the webhook in the RevenueCat dashboard pointing at that URL with the bearer token shown in the layer settings.
Multi-project
One Layers project can link to multiple RevenueCat projects (each
creates its own revenuecat_accounts row). The Revenue dashboard
shows the union, filterable via the account picker.
Disconnect
From the layer settings, click Disconnect. The connection is removed and the stored tokens are deleted from Vault. Historical metrics already written to Layers remain visible.