RevenueCat

Handle RevenueCat webhooks and store subscription state in Convex with real-time reactivity for subscription access control.

Installation

npm install convex-revenuecat

About RevenueCat

Convex component for webhook-driven RevenueCat subscription state. Stores entitlements in your database for reactive, real-time access control.

This component receives RevenueCat webhooks and maintains subscription state in your Convex database. Use it to:

Check if users have active entitlements (e.g., "premium" access)
Query subscription status with Convex's real-time reactivity

Features:
- Webhook Processing: Idempotent handling of all 18 RevenueCat webhook events
- Convex Integration: Data stored in Convex tables with real-time reactivity
- Correct Edge Cases: Cancellation keeps access until expiration, pause doesn't revoke, etc.
- Rate Limiting: Built-in protection against webhook abuse (100 req/min per app)
- Subscriber Attributes: Stores customer attributes from webhooks
- Experiment Tracking: Tracks A/B test enrollments
- TypeScript: Typed API methods (webhook payloads stored as-is)

Benefits

Use cases

how to check user subscription status in Convex

convex-revenuecat stores entitlements in your Convex database, letting you query subscription status with useQuery hooks. The component processes RevenueCat webhooks to maintain real-time subscription state including active entitlements and expiration dates.

handle RevenueCat webhooks in Convex backend

This component provides idempotent webhook handlers for all RevenueCat events, automatically updating subscription state in your database. It handles edge cases like keeping access until cancellation expiration and proper pause behavior.

real-time subscription access control

Store RevenueCat entitlements in Convex tables for reactive queries that update UI instantly when subscriptions change. Check premium access with standard Convex queries that automatically re-run when webhook events update the data.

Frequently asked questions

Does this component handle RevenueCat webhook retries correctly?

Yes, convex-revenuecat processes all webhook events idempotently, meaning duplicate webhook deliveries won't corrupt your data. It also includes built-in rate limiting at 100 requests per minute per app to protect against webhook abuse.

What subscription data does this store in my Convex database?

The convex-revenuecat component stores entitlements, subscription status, subscriber attributes, and A/B test enrollments. Webhook payloads are stored as-is while providing typed API methods for accessing the subscription state.

How does this handle subscription cancellations and pauses?

convex-revenuecat correctly handles edge cases where cancellation keeps access until the expiration date and paused subscriptions don't immediately revoke access. It processes all 18 RevenueCat webhook event types with proper business logic.

Can I query subscription status reactively with this component?

Yes, since convex-revenuecat stores all subscription data in Convex tables, you can use standard useQuery hooks to reactively check entitlements. Your UI automatically updates when webhook events change subscription state.

Links