revenuecat-entitlements-gate
Check whether a RevenueCat user currently has access to a paid feature via entitlements. Use when the user asks to gate a feature behind premium, check if the user has a pro subscription, read customerInfo active entitlements, show or hide a feature based on subscription status, react to entitlement changes, or 'is the user subscribed' on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.
How do I install this agent skill?
npx skills add https://github.com/revenuecat/ai-toolkit --skill revenuecat-entitlements-gateIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides documentation and code snippets for integrating RevenueCat entitlement checks in mobile applications across multiple platforms. It follows official best practices and does not contain any malicious patterns or security vulnerabilities.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
revenuecat-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.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/revenuecat/ai-toolkit/revenuecat-entitlements-gate">View revenuecat-entitlements-gate on skillZs</a>