rc-subscriptions
БесплатноБез исполняемых скриптовНе проверенUse this skill when modeling subscriptions through RevenueCat's object model on Android. Covers Offerings, Packages, StoreProduct, SubscriptionOption…
от RevenueCat★ 80 звёзд на GitHubОб этом скилле
Subscriptions on Android with RevenueCat
Google Play exposes subscriptions through a three tier hierarchy: Subscription, Base Plan, and Offer. RevenueCat wraps that hierarchy in a flatter model you configure from the dashboard: Offerings, Packages, and SubscriptionOptions. You fetch an Offering, pick a Package, and in most flows let the SDK choose the right SubscriptionOption for you.
Phase 1: Understand
The mapping from Google Play to RevenueCat:
| Google Play | RevenueCat |
|---|---|
Subscription + Base Plan (subId:basePlanId) |
StoreProduct (one per base plan) |
| Base Plan without offer | SubscriptionOption with isBasePlan == true |
| Offer on that base plan | SubscriptionOption (offer) |
| Group of base plans grouped in dashboard | Package inside an Offering |
Key types you will touch:
Offering: a dashboard configured group ofPackageobjects.offerings.currentis the one you show by default.Package: a purchasable slot (monthly, annual, weekly, custom). Exposes aproduct: StoreProduct.StoreProduct: one base plan of a Google Play subscription (idissubId:basePlanId). ItssubscriptionOptionshold that base plan and its offers, plus adefaultOption.SubscriptionOption: either a base plan or an offer. HaspricingPhases,tags, and anid.PricingPhase: one billing segment (intro trial, intro price, or recurring). HasbillingPeriod,price,offerPaymentMode, andrecurrenceMode.
See the Subscriptions chapter on revenuecat.com for the object model diagram showing the full Offerings hierarchy alongside the CustomerInfo hierarchy used for entitlement checks.
Phase 2: Plan
Before you write code, map your paywall to the object model. Answer these three questions.
2.1 Which Offering drives the paywall?
- Default paywall: use
offerings.current. This is the Default offering set in the dashboard and is the standard choice. - Experiment or segment specific paywall: fetch
offerings.all["experiment-a"]. You keep the dashboard in charge of which products appear, so no app update ships when the catalog changes.
2.2 Which Packages do you show?
Two access patterns, pick the one that matches your layout:
| Pattern | API | When to use |
|---|---|---|
| Named slots | offering.monthly, offering.annual, offering.weekly |
Fixed paywall with known durations |
| Iteration | offering.availablePackages |
Dynamic layout, unknown durations, or custom package types |
Standard PackageType values: MONTHLY, ANNUAL, WEEKLY, TWO_MONTH, THREE_MONTH, SIX_MONTH, LIFETIME. Anything else is PackageType.CUSTOM.
2.3 Does the paywall need a specific offer, or is the default fine?
| Situation | What to pass to PurchaseParams |
|---|---|
| Standard paywall, user gets best eligible offer automatically | Package |
| You need a specific offer (win back, promo, tag selected) | SubscriptionOption |
The SDK's defaultOption logic:
- Filters out options tagged
"rc-ignore-offer"or"rc-customer-center". - Picks the option with the longest free trial or the cheapest first phase.
- Falls back to the base plan if no offer qualifies.
Trial eligibility is not filtered by the SDK. Google Play only returns offers the user is eligible for, so if a user already consumed a free trial, that option simply will not appear in subscriptionOptions and the base plan becomes the default.
Phase 3: Execute
3.1 Pull Offerings and pick a Package
val offerings = Purchases.sharedInstance.awaitOfferings()
val offering = offerings.current ?: return
val monthly = offering.monthly ?: return
val product = monthly.product
val price = product.price.formatted
val period = product.period?.iso8601 // "P1M", "P1Y", null for one time
For a dynamic list:
for (pkg in offering.availablePackages) {
render(pkg.product.title, pkg.product.price.formatted, pkg.packageType)
}
3.2 Purchase with the default option
When the paywall shows a Package and you want the SDK to pick the best offer, pass the Package directly.
val params = PurchaseParams.Builder(activity, monthly).build()
val result = Purchases.sharedInstance.awaitPurchase(params)
3.3 Drill into subscriptionOptions for a specific offer
Use this when the paywall targets an offer by tag or offer ID, for example a win back offer.
val product = offering.monthly?.product ?: return
val winBack = product.subscriptionOptions
?.firstOrNull { it.tags.contains("win-back") }
val option = winBack ?: product.defaultOption ?: return
val params = PurchaseParams.Builder(activity, option).build()
Always fall back to defaultOption so the paywall still works when the targeted offer is absent (for example, the user is not eligible).
3.4 Render trial and intro pricing from pricingPhases
The first PricingPhase is the trial or intro
Установить rc-subscriptions в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rc-subscriptions?
Use this skill when modeling subscriptions through RevenueCat's object model on Android. Covers Offerings, Packages, StoreProduct, SubscriptionOption, PricingPhase, and how they map to Google Play's Subscription, Base Plan, and Offer hierarchy.
Как установить скилл rc-subscriptions?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rc-subscriptions запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic