Documentation
RevenueCat
Forward RevenueCat webhook events to AppSprint so every subscription and purchase is automatically attributed to the install that triggered it.
Webhook endpoint
https://api.appsprint.app/v1/webhooks/revenuecat
Paste this URL into RevenueCat → Project Settings → Integrations → Webhooks.
Authentication
Set the Authorization headerin RevenueCat's webhook config to a Bearer token matching your app's revenuecatWebhookToken stored in the AppSprint dashboard under Integrations → RevenueCat.
Authorization: Bearer rc_whsec_xxxxxxxx
Event mapping
RevenueCat webhook event types are mapped to AppSprint event names:
| RevenueCat event | AppSprint event |
|---|---|
| INITIAL_PURCHASE | purchase |
| RENEWAL | renewal |
| CANCELLATION | cancellation |
| UNCANCELLATION | uncancellation |
| NON_RENEWING_PURCHASE | purchase |
| SUBSCRIPTION_PAUSED | subscription_paused |
| EXPIRATION | expiration |
| BILLING_ISSUE | billing_issue |
| PRODUCT_CHANGE | product_change |
Required: $appsprintId subscriber attribute
For webhooks to be matched to an attribution, you must set the $appsprintId subscriber attribute in RevenueCat from the SDK. This links the RevenueCat subscriber to the AppSprint install.
SDK snippets
Set the subscriber attribute after the AppSprint SDK is configured:
iOS
import AppSprintSDKimport RevenueCatlet appsprintId = AppSprint.shared.getAppSprintId()if let appsprintId {await Purchases.shared.attribution.setAttributes(["appsprintId": appsprintId])}
React Native
import { AppSprint } from 'appsprint-react-native';import Purchases from 'react-native-purchases';const appsprintId = AppSprint.getAppSprintId();if (appsprintId) {await Purchases.setAttributes({ appsprintId });}
Android
import com.appsprint.sdk.AppSprintimport com.revenuecat.purchases.Purchasesval appsprintId = AppSprint.shared(applicationContext).getAppSprintId()if (appsprintId != null) {Purchases.sharedInstance.setAttributes(mapOf("appsprintId" to appsprintId))}
Flutter
import 'package:appsprint_flutter/appsprint_flutter.dart';import 'package:purchases_flutter/purchases_flutter.dart';final appsprintId = AppSprint.instance.getAppSprintId();if (appsprintId != null) {await Purchases.setAttributes({'appsprintId': appsprintId});}