About revenuecat-entitlements-gate
A guide for cross-platform app developers implementing RevenueCat entitlement gates. It detects the project platform and covers one-time checks, change listeners, and verification.
Key features
- 01Detect React Native, Flutter, KMP, Android, and iOS
- 02Check active entitlements
- 03Listen for entitlement changes
- 04Distinguish entitlement identifiers from product IDs
- 05Verify gating and UI updates
Use cases
- 01Show or hide features based on active entitlements
- 02Update the UI when entitlement status changes
- 03Check entitlement identifiers or listener setup
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ revenuecat/ ai-toolkit --skill revenuecat-entitlements-gateAfter installing, type/revenuecat-entitlements-gatein Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
platforms/android.mdflutter.mdios.mdkmp.mdreact-native.mdDetails
From the project READMErevenuecat-entitlements-gate: check a RevenueCat entitlement
Use this skill when the user wants to decide whether to show or hide a feature based on an active RevenueCat entitlement. The skill covers the one shot check and the reactive listener; it does not cover purchasing (see revenuecat-purchase-flow) or auth (revenuecat-identify-user).
1. Detect the platform
Inspect the working directory and pick the first match, from top to bottom:
- React Native:
package.jsonhas areact-native-purchasesentry, orreact-nativeas a dependency → readplatforms/react-native.md. Ifexpois also a dependency, note it as an Expo project. - Flutter:
pubspec.yamlexists at the project root → readplatforms/flutter.md. - Kotlin Multiplatform:
build.gradle.ktscontains akotlin { … }multiplatform source sets block, or depends oncom.revenuecat.purchases:purchases-kmp*→ readplatforms/kmp.md. - Android (native):
build.gradle(.kts)appliescom.android.application(and is not KMP) → readplatforms/android.md. - iOS (native):
Package.swift,*.xcodeproj,*.xcworkspace, orPodfileat the project root → readplatforms/ios.md.
If several match (e.g. an ios/ folder inside a Flutter project), pick the outermost project, the one that owns the build. If still ambiguous, ask the user which platform they want to configure.
2. Shared concepts (all platforms)
- Check the entitlement identifier, not the product ID. The identifier (for example
"premium") is configured in the RevenueCat dashboard and mapped to one or more products. Using the entitlement lets you change products, prices, and stores without touching app code. customerInfo.entitlements.activeis the source of truth. It is aMap<String, EntitlementInfo>keyed by entitlement identifier. Presence inactivemeans the user currently has access. Absence means they do not, regardless of past purchases.- Do not gate on purchase history. Expired subscriptions still appear in
customerInfo.entitlements.allbut drop out ofactive. Useactiveonly. - Fetch once, then subscribe. The first
customerInfocall returns a cached value quickly, and the SDK refreshes in the background. Every SDK exposes a listener or stream that fires when entitlements change (after a purchase, restore, renewal, or expiration). Subscribe to that instead of polling. - The SDK must be configured first. If
Purchases.configure(…)has not run, the entitlement call will fail. Set up the SDK viaintegrate-revenuecatbefore using this skill.
3. Implementation
Read the platform file that matches detection:
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.md
Each platform file shows the one shot check, the reactive subscription, and where to place each in a typical app.
4. Verify
Do not claim the gate works until:
- A user with an active entitlement sees the gated feature, and a user without it does not.
- When the entitlement state changes (test with a sandbox purchase or a manual grant in the dashboard), the UI updates without a manual restart, confirming the listener is wired.
- The entitlement identifier in the code matches an identifier that exists in the RevenueCat dashboard. A typo here silently gates everyone out.