Amba
Integrations

RevenueCat

Integrate RevenueCat for subscription management and entitlements.

Connect RevenueCat to sync subscription status and entitlements with Amba. When a user subscribes via RevenueCat, their entitlements are automatically updated in Amba.

The same integration also powers the Monetization Control Plane — declare your entitlements, products, and offerings as code and plan / apply them to RevenueCat (quickstart).

RevenueCat handles App Store and Play Store subscriptions. For web checkout, follow RevenueCat's documented Stripe Billing path with the built-in Web Subscriptions integration — web purchases grant the same entitlements through the same cascade. For everything else — manual support grants, gift codes, ToS-violation revokes, migrations from legacy systems — use POST /admin/projects/:projectId/users/:userId/entitlements to grant the same entitlement directly. All paths produce the same entitlement and are read through the same client API.

Setup

1. Configure the integration

Via MCP:

amba_integrations_configure({
  project_id: "proj_xxx",
  provider: "revenuecat",
  config: {
    secret_api_key: "your_revenuecat_secret_api_key",
    webhook_secret: "your_webhook_secret"
  }
})

Via Admin API:

POST /admin/integrations
{
  "provider": "revenuecat",
  "config": {
    "secret_api_key": "your_revenuecat_secret_api_key",
    "webhook_secret": "your_webhook_secret"
  }
}

secret_api_key is RevenueCat's secret REST API key (api_key is still accepted on older rows). To use the Monetization Control Plane's apply, also supply a read-write key (project_configuration:*:read_write) as secret_api_key_write — or use one full-access key for both. Keys are resolved server-side and never returned to a client.

2. Set up the webhook

The API returns a webhook URL when you configure the integration:

https://api.amba.dev/webhooks/revenuecat?project_id=proj_xxx

Add this URL in your RevenueCat dashboard under Project Settings > Integrations > Webhooks, and set the webhook's Authorization header value to Bearer <webhook_secret> — the literal word Bearer, a space, then the same webhook_secret you configured above. Amba compares the full header value on every delivery (constant-time) and rejects deliveries that do not match.

3. Webhook events

Amba processes these RevenueCat webhook events:

EventAction
INITIAL_PURCHASEGrants entitlements; fires the reward cascade
RENEWALGrants/extends entitlements; fires the reward cascade
NON_RENEWING_PURCHASEGrants entitlements; fires the reward cascade
PRODUCT_CHANGEGrants entitlements for the new product
UNCANCELLATIONRe-grants entitlements
CANCELLATIONKeeps access until the paid period ends (auto-renew off ≠ revoke)
EXPIRATIONDeactivates entitlements
REFUNDDeactivates entitlements
SUBSCRIPTION_PAUSEDDeactivates entitlements

Other event types that carry entitlement IDs are treated conservatively as grants. Every fresh event also updates the neutral subscription_* user properties (subscription_active, subscription_last_event, subscription_product_id, subscription_store), dedupes on RevenueCat's event ID, and carries an ordering watermark so a delayed EXPIRATION cannot clobber a newer RENEWAL.

Deliveries are authenticated by comparing the Authorization header against Bearer <webhook_secret> in constant time.

Admin API reference

MethodPathDescription
POST/admin/integrationsConfigure integration
GET/admin/integrationsList active integrations
PATCH/admin/integrations/revenuecatUpdate config
POST/admin/integrations/revenuecat/testTest connection

Checking entitlements in the SDK

const entitlements = await client.entitlements.list();
// Returns: [{ entitlement_id: "premium", is_active: true, store: "app_store",
//            product_id: "...", period_type: "normal",
//            purchase_date: "...", expiration_date: "2025-02-14T..." }]
 
const isPremium = await client.entitlements.has('premium');
// Returns: true

On this page