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.

Setup

1. Configure the integration

Via MCP:

amba_configure_integration({
  project_id: "proj_xxx",
  provider: "revenuecat",
  config: {
    api_key: "your_revenuecat_api_key",
    shared_secret: "webhook_shared_secret"
  }
})

Via Admin API:

POST /admin/integrations
{
  "provider": "revenuecat",
  "config": {
    "api_key": "your_revenuecat_api_key",
    "shared_secret": "webhook_shared_secret"
  }
}

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.

3. Webhook events

Amba processes these RevenueCat webhook events:

EventAction
INITIAL_PURCHASECreates/updates user entitlement
RENEWALExtends entitlement expiry
CANCELLATIONMarks entitlement for expiry at period end
EXPIRATIONDeactivates entitlement
BILLING_ISSUEFlags billing issue on entitlement

Webhook payloads are verified using HMAC with the shared secret.

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.getAll();
// Returns: [{ id: "premium", is_active: true, expires_at: "2025-02-14T..." }]
 
const isPremium = await client.entitlements.isActive('premium');
// Returns: true

Database tables

TablePurpose
project_integrationsIntegration config (encrypted)
user_entitlementsEntitlement records with status and expiry

On this page