revenuecat-supabase-entitlementslisted
Install: claude install-skill tanfust/skills
# RevenueCat entitlements in Supabase
The client already knows whether the user is subscribed; the SDK caches `CustomerInfo` and the paywall reads it instantly. The problem is that a client can be patched, and Postgres cannot ask the SDK. So a premium table needs an `entitlements` row it can join on, and that row is written by a webhook you own. The failures are all quiet: a `BILLING_ISSUE` handled as "revoke" cuts off a customer whose card retry succeeds tomorrow; a `CANCELLATION` handled as "keep until expiry" keeps access after a refund; a `TRANSFER` skipped because it carries no `entitlement_ids` leaves the old account subscribed forever; a TestFlight tester's sandbox purchase unlocks production rows. RevenueCat's own guidance avoids all of this with one move, and this skill is that move plus the checks.
Extracted from a shipped Flutter and Supabase codebase. Every RevenueCat fact is quoted with its source in `references/EVENTS.md`; the table, function and paywall states are in `references/SCHEMA.md`.
## Order of work
1. Make the app user id the Supabase uid
2. Create the table and the RLS that reads it
3. Deploy the webhook function without JWT verification and with its own auth
4. Treat the event as a trigger: dedupe, fetch, write
5. Keep sandbox out of production
6. Render the paywall from the SDK, gate content from the table
7. Verify
## 1. Make the app user id the Supabase uid
Everything downstream keys on `event.app_user_id` being a value that exists in `auth.