<!--
App*Sprint* docs markdown
Canonical HTML: https://appsprint.app/attribution/docs/revenuecat
Markdown URL: https://appsprint.app/attribution/docs/revenuecat.md
Docs index: https://appsprint.app/attribution/docs.md
Sitemap: https://appsprint.app/attribution/sitemap.xml
LLM guide: https://appsprint.app/attribution/llms.txt
-->

# RevenueCat

Forward RevenueCat webhook events to App*Sprint* so every subscription and purchase is automatically attributed to the install that triggered it.

## Webhook endpoint

```
Host: api.appsprint.app
Path: /v1/integrations/revenuecat/webhooks/{appId}
```

Paste the HTTPS URL for this host and path into RevenueCat → Project Settings → Integrations → Webhooks.

Replace `{appId}` with your App*Sprint* app ID. The dashboard integration page shows the full URL for the selected app.

## Authentication

Set the Authorization header in RevenueCat's webhook config to a Bearer token matching your app's `revenuecatWebhookToken` stored in the App*Sprint* dashboard under Integrations → RevenueCat.

```
Authorization: Bearer rc_whsec_xxxxxxxx
```

## Event mapping

| RevenueCat event | App*Sprint* event |
|-----------------|-----------------|
| INITIAL_PURCHASE | purchase |
| INITIAL_PURCHASE + period_type=TRIAL | start_trial |
| RENEWAL, including is_trial_conversion=true | subscribe |
| UNCANCELLATION | purchase |
| NON_RENEWING_PURCHASE | purchase |
| CANCELLATION / EXPIRATION / BILLING_ISSUE / PRODUCT_CHANGE / SUBSCRIPTION_PAUSED / TRANSFER / REFUND_REVERSED | custom |

Custom lifecycle events keep the raw RevenueCat type in the event name, for example `revenuecat:cancellation`. Other RevenueCat event types are stored as webhook receipts but ignored for App*Sprint* event attribution.

App*Sprint* marks the integration verified after the first valid webhook. Sandbox webhooks can verify the connection, but App*Sprint* does not create attributed events or outbound ad conversions from `environment=SANDBOX` deliveries.

## Required: appsprintId subscriber attribute

For webhooks to be matched to an attribution, you must set the `appsprintId` subscriber attribute in RevenueCat from the SDK.

## SDK snippets

Set the subscriber attribute after the App*Sprint* SDK is configured. In React Native and Flutter, `getAppSprintId()` is asynchronous, so await it before calling RevenueCat. See the RevenueCat docs page for platform-specific code snippets.

---

## Docs navigation

Use the Markdown URLs when reading the docs programmatically. Use the HTML URLs when you need the interactive docs UI.

- [Overview](https://appsprint.app/attribution/docs) ([Markdown](https://appsprint.app/attribution/docs.md)) — Introduction to App*Sprint*
- [Quickstart](https://appsprint.app/attribution/docs/quickstart) ([Markdown](https://appsprint.app/attribution/docs/quickstart.md)) — Get up and running in 5 minutes
- [React Native](https://appsprint.app/attribution/docs/react-native) ([Markdown](https://appsprint.app/attribution/docs/react-native.md)) — React Native / Expo SDK reference
- [iOS (Swift)](https://appsprint.app/attribution/docs/ios-swift) ([Markdown](https://appsprint.app/attribution/docs/ios-swift.md)) — Native Swift SDK reference
- [Android (Kotlin)](https://appsprint.app/attribution/docs/android) ([Markdown](https://appsprint.app/attribution/docs/android.md)) — Native Android SDK reference
- [Flutter](https://appsprint.app/attribution/docs/flutter) ([Markdown](https://appsprint.app/attribution/docs/flutter.md)) — Flutter plugin reference
- [RevenueCat](https://appsprint.app/attribution/docs/revenuecat) ([Markdown](https://appsprint.app/attribution/docs/revenuecat.md)) — Webhook integration for subscription attribution
- [Superwall](https://appsprint.app/attribution/docs/superwall) ([Markdown](https://appsprint.app/attribution/docs/superwall.md)) — Webhook integration for paywall attribution
- [Apple Search Ads](https://appsprint.app/attribution/docs/apple-search-ads) ([Markdown](https://appsprint.app/attribution/docs/apple-search-ads.md)) — Keyword and ad attribution
- [Google Ads](https://appsprint.app/attribution/docs/google-ads) ([Markdown](https://appsprint.app/attribution/docs/google-ads.md)) — Coming soon
- [TikTok Ads](https://appsprint.app/attribution/docs/tiktok-ads) ([Markdown](https://appsprint.app/attribution/docs/tiktok-ads.md)) — Events API server-side event forwarding
- [Meta Ads](https://appsprint.app/attribution/docs/meta-ads) ([Markdown](https://appsprint.app/attribution/docs/meta-ads.md)) — In review
