Subscriptions logo

Subscriptions

Organization
RevenueCat
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.

Overview

PublisherRevenueCat
Repositoryplay-billing-skills
Skill namesubscriptions
Stars
58
Forks
0
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by RevenueCat on GitHub. Read the source before you install it.

Installation

Install the Subscriptions AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/RevenueCat/play-billing-skills/tree/main/revenuecat/subscriptions
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RevenueCat/play-billing-skills.git /tmp/play-billing-skills
mkdir -p .claude/skills
cp -r /tmp/play-billing-skills/revenuecat/subscriptions .claude/skills/subscriptions
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Subscriptions in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Subscriptions on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Subscriptions is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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 PlayRevenueCat
Subscription + Base Plan (subId:basePlanId)StoreProduct (one per base plan)
Base Plan without offerSubscriptionOption with isBasePlan == true
Offer on that base planSubscriptionOption (offer)
Group of base plans grouped in dashboardPackage inside an Offering

Key types you will touch:

  • Offering: a dashboard configured group of Package objects. offerings.current is the one you show by default.
  • Package: a purchasable slot (monthly, annual, weekly, custom). Exposes a product: StoreProduct.
  • StoreProduct: one base plan of a Google Play subscription (id is subId:basePlanId). Its subscriptionOptions hold that base plan and its offers, plus a defaultOption.
  • SubscriptionOption: either a base plan or an offer. Has pricingPhases, tags, and an id.
  • PricingPhase: one billing segment (intro trial, intro price, or recurring). Has billingPeriod, price, offerPaymentMode, and recurrenceMode.

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:

PatternAPIWhen to use
Named slotsoffering.monthly, offering.annual, offering.weeklyFixed paywall with known durations
Iterationoffering.availablePackagesDynamic 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?

SituationWhat to pass to PurchaseParams
Standard paywall, user gets best eligible offer automaticallyPackage
You need a specific offer (win back, promo, tag selected)SubscriptionOption

The SDK's defaultOption logic:

  1. Filters out options tagged "rc-ignore-offer" or "rc-customer-center".
  2. Picks the option with the longest free trial or the cheapest first phase.
  3. 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

kotlin
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:

kotlin
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.

kotlin
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.

kotlin
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 price when present. Use offerPaymentMode for trial detection.

kotlin
val option = pkg.product.defaultOption ?: return
val first = option.pricingPhases.first()
val isTrial = first.offerPaymentMode == OfferPaymentMode.FREE_TRIAL

billingPeriod.value is the count in the period's unit, not days. A P1W period gives value = 1, unit = WEEK. Build labels off both fields:

kotlin
val p = first.billingPeriod
val label = when (p.unit) {
    Period.Unit.DAY -> "${p.value} day"
    Period.Unit.WEEK -> "${p.value} week"
    Period.Unit.MONTH -> "${p.value} month"
    Period.Unit.YEAR -> "${p.value} year"
    else -> p.iso8601
}

3.5 Prepaid plans

Prepaid base plans use the same SubscriptionOption API. Their pricingPhases report RecurrenceMode.NON_RECURRING. To accept pending purchases for prepaid plans, enable the flag at configuration time.

kotlin
PurchasesConfiguration.Builder(context, apiKey)
    .pendingTransactionsForPrepaidPlansEnabled(true)
    .build()

3.6 Check access after purchase

Prefer entitlements. They reflect server computed access state including grace period, account hold, and cancellation with remaining time.

kotlin
val info = result.customerInfo
val isPro = info.entitlements["pro"]?.isActive == true

If you need the raw product ID, use customerInfo.activeSubscriptions. It returns a Set<String> of "subscriptionId:basePlanId" entries.

Decision summary

QuestionAnswer
How do I fetch products?Purchases.sharedInstance.awaitOfferings() then offerings.current.
How do I present durations?offering.monthly/annual/weekly or iterate availablePackages.
How do I purchase?Pass the Package to PurchaseParams and let defaultOption apply.
How do I target a specific offer?Filter product.subscriptionOptions by tag or ID, pass the SubscriptionOption.
How do I detect a free trial?pricingPhases.first().offerPaymentMode == OfferPaymentMode.FREE_TRIAL.
How do I check access?customerInfo.entitlements["<id>"]?.isActive.

References

Frequently asked questions

What does the Subscriptions AI skill do?

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.

Why use Subscriptions on TypingMind?

Because you install it once and use it with any model. Subscriptions is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Subscriptions in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/RevenueCat/play-billing-skills/tree/main/revenuecat/subscriptions. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Subscriptions?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Subscriptions?

As many as you like. As long as a model supports skills, you can use Subscriptions with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Subscriptions AI skill free?

Yes. It is published on GitHub by RevenueCat under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇