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 eventAppSprint event
INITIAL_PURCHASEpurchase
RENEWALrenewal
CANCELLATIONcancellation
UNCANCELLATIONuncancellation
NON_RENEWING_PURCHASEpurchase
SUBSCRIPTION_PAUSEDsubscription_paused
EXPIRATIONexpiration
BILLING_ISSUEbilling_issue
PRODUCT_CHANGEproduct_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 AppSprintSDK
import RevenueCat
let 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.AppSprint
import com.revenuecat.purchases.Purchases
val 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});
}