Add revenue with RevenueCat
Connect RevenueCat to Cockpitify with a v2 secret key so purchases, renewals and cancellations are matched to your Supabase users.
Connecting RevenueCat brings each user’s purchases, renewals, cancellations and refunds into Cockpitify, matched to your Supabase users. It powers revenue per user, margin and the premium notifications.
Before you start
Create a secret key in RevenueCat:
- In RevenueCat, open your project, then Project settings → API keys.
- Create a New secret key of the v2 type.
- Give it these permissions:
- Customer information: Read
- Project configuration: Read & write (so Cockpitify can register the webhook for you)
- Copy the key. It starts with
sk_.
Connect
- Open the Services tab and tap Connect on the RevenueCat card. You can also get there from the Margin tab (Connect RevenueCat) or the setup checklist.
- Paste the key into RevenueCat secret key (API v2).
- Check User mapping. By default RevenueCat’s
app_user_idis your Supabase user ID (auth.uid). If your app uses another ID, Cockpitify can match on a column of your profile table instead. - Leave Include test purchases off unless you’re testing. When on, sandbox purchases count toward revenue and notifications.
- Tap Connect and import.
The key is stored in your project’s Supabase Vault. Cockpitify registers the webhook in RevenueCat and starts importing the last 12 months of history in the background, one batch a minute.
Add the webhook by hand
If the key can’t change project configuration, the webhook pill says Add manually and you get a URL and an Authorization value:
- In RevenueCat, open Integrations → Webhooks → Add.
- Paste the Webhook URL and the Authorization value from Cockpitify.
- Save, then use Send test event in RevenueCat. Cockpitify shows when the test event arrived.
Check that it works
The RevenueCat screen shows:
- Last event, or a note that only a test event has arrived so far.
- The import status: Importing history…, History imported or Import stopped, with how many customers and payments were scanned.
- Events that aren’t matched to a user yet. New events match once the mapping is right.
Store fees and tax
RevenueCat sends the store commission and tax with most sales, and Cockpitify uses them: net = gross × (1 − tax − commission). When a sale arrives without a commission, Cockpitify uses the rate you choose under When no commission is sent: 15% · Small Business or 30%.
RevenueCat’s own fee
The RevenueCat card on the Services tab tracks how much revenue RevenueCat has counted this month against its free allowance, with a month-end estimate. You get a notification when the free limit is close and when RevenueCat starts billing.
Disconnect
Tap Disconnect on the RevenueCat screen. The key and the webhook are deleted; revenue already saved stays, and if you connect again it picks up where it left off.