rc-configuring-the-sdk — скилл для Claude Code: настройка RevenueCat
Скилл проводит агента через подключение RevenueCat к Android-приложению: Gradle-зависимость, Purchases.configure, стратегия app user id и уровень логов.
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a claude-codeЧто делает rc-configuring-the-sdk
Скилл описывает три фазы. Сначала агент ищет в проекте уже существующий вызов Purchases.configure и старый биллинг на BillingClient, потом решает, где вызывать configure — в Application.onCreate или в первой Activity.onCreate — и какой app user id передавать. Дальше идёт код: зависимость com.revenuecat.purchases:purchases в build.gradle.kts, настройка PurchasesConfiguration.Builder и проверка через запрос offerings.
Один вызов configure заменяет ручную работу с BillingClient: создание и закрытие клиента, startConnection, переподключение при SERVICE_DISCONNECTED, запрос незавершённых транзакций на старте. Вызывать configure нужно ровно один раз на процесс — если он уже стоит в коде, скилл велит остановиться и согласовать изменения с вами.
Публичный Android SDK-ключ скилл советует держать вне исходников и подставлять через BuildConfig или секрет-менеджер. Логи в релизе стоит гасить через BuildConfig.DEBUG, иначе LogLevel.DEBUG уедет в продакшен. Если offerings возвращают null, причина обычно в несовпадении package name между Play Console и дашбордом.
Какие задачи решает
- добавить RevenueCat в Android-проект и не забыть про Gradle-синк
- выбрать между анонимным и известным app user id на старте
- убрать ручное управление
BillingClientи переподключениями - развести уровни логов между debug- и release-сборкой
- найти причину, по которой offerings приходят пустыми
Примеры запросов агенту
- подключи RevenueCat Android SDK к этому проекту
- настрой
Purchases.configureвApplication.onCreateс анонимным app user id - проверь, почему
offerings.currentвозвращает null
Как установить rc-configuring-the-sdk
1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a claude-code2Вручную: положить файлы
~/.claude/skills/rc-configuring-the-sdk/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/rc-configuring-the-sdk/
1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a codex2Вручную: положить файлы
.agents/skills/rc-configuring-the-sdk/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a cursor2Вручную: положить файлы
.cursor/skills/rc-configuring-the-sdk/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install RevenueCat/ai-toolkit rc-configuring-the-sdk2Вручную: положить файлы
.github/skills/rc-configuring-the-sdk/SKILL.md1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a gemini-cli2Командой платформы
gemini skills install https://github.com/RevenueCat/ai-toolkit --path revenuecat-play-billing/skills/rc-configuring-the-sdkВручную: положить файлы
.devin/skills/rc-configuring-the-sdk/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о rc-configuring-the-sdk
Как установить rc-configuring-the-sdk в Claude?
Выполните npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a claude-code. Файл скилла появится по пути ~/.claude/skills/rc-configuring-the-sdk/SKILL.md.
Что делает rc-configuring-the-sdk?
Ведёт агента по подключению RevenueCat Android SDK: ищет существующий configure и старый биллинг, добавляет Gradle-зависимость, пишет вызов Purchases.configure и проверяет связку запросом offerings.
Нужен ли ключ API для работы скилла?
Да, PurchasesConfiguration.Builder принимает публичный Android SDK-ключ. Скилл советует не хранить его в исходниках, а передавать через BuildConfig или секрет-менеджер.
Исходный текст
SKILL.md · MIT
---
name: rc-configuring-the-sdk
description: Use this skill when adding and configuring the RevenueCat Android SDK (purchases-kt/purchases) in an app. Covers the Gradle dependency, Purchases.configure with PurchasesConfiguration, initial app user id strategy, and log level.
license: Apache-2.0; see LICENSE
metadata:
author: RevenueCat
source: revenuecat-handbook chapter 5
keywords:
- android
- revenuecat
- configure
- purchases-configuration
- app-user-id
- sdk
---
# Configuring the RevenueCat Android SDK
Use this skill to add and configure RevenueCat (`purchases-kt`) in an Android app. A single `Purchases.configure` call replaces `BillingClient` setup, connection lifecycle management, reconnection handling, and launch-time purchase queries.
Work through the phases in order. The [full chapter on revenuecat.com](https://www.revenuecat.com/guides/revenuecat-android-sdk/configuring-the-sdk) has the complete reference text.
## Phase 1: Discovery
Find out whether RevenueCat is already wired up and where billing code currently lives.
1. Search for an existing configure call and prior SDK version.
```bash
rg -n "Purchases\.configure|PurchasesConfiguration" --type kotlin --type java
rg -n "com\.revenuecat\.purchases" -g '*.gradle*' -g '*.toml'
```
2. Search for the existing billing surface you may be replacing.
```bash
rg -n "BillingClient|PurchasesUpdatedListener|startConnection" --type kotlin --type java
```
3. Record answers before moving on.
| Question | Where to look |
| --- | --- |
| Is `Purchases.configure` already called? | App startup, `Application.onCreate`, main `Activity.onCreate` |
| Which module owns billing today? | `app/build.gradle(.kts)`, any `:billing` module |
| Is there an auth system with a stable user id? | Login flow, session store |
| Debug vs release build detection available? | `BuildConfig.DEBUG` |
If `Purchases.configure` already runs, stop and confirm with the user before changing it. Configuration runs once per process.
## Phase 2: Plan
Decide three things before writing code.
### 2.1 Where to call configure
| Location | When to choose |
| --- | --- |
| `Application.onCreate` | Default. Ensures the SDK is ready before any `Activity` or background work touches purchases. |
| First `Activity.onCreate` | Only if the app has no custom `Application` class and you are not willing to add one. |
Call `configure` exactly once per process. Calling it from an `Activity` risks re-running it on configuration changes if you are not careful; the `Application` path avoids that.
### 2.2 App user id strategy
| Strategy | Pass to `appUserID` | Use when |
| --- | --- | --- |
| Anonymous | `null` | Users can purchase before signing in, or you have no auth. Later call `Purchases.sharedInstance.logIn(id)` to merge history. |
| Known user | Your stable backend id (for example `"user_12345"`) | Users are always authenticated before purchase. |
Do not pass device ids, email addresses, or values that can change. If you do not have the id at startup, configure anonymously and call `logIn` after authentication.
### 2.3 Log level
| Build | Log level |
| --- | --- |
| Debug | `LogLevel.DEBUG` or `VERBOSE` while integrating |
| Release | `LogLevel.INFO` (default) or `WARN` |
Switch on `BuildConfig.DEBUG` so production builds stay quiet.
## Phase 3: Execute
### 3.1 Add the Gradle dependency
In the app module `build.gradle.kts`:
```kotlin
dependencies {
implementation("com.revenuecat.purchases:purchases:<latest>")
}
```
Replace `<latest>` with the current published version. If the project uses a Groovy `build.gradle`, use `implementation 'com.revenuecat.purchases:purchases:<latest>'`. Sync Gradle after the change.
### 3.2 Call configure at startup
In your `Application` subclass:
```kotlin
class App : Application() {
override fun onCreate() {
super.onCreate()
Purchases.logLevel =
if (BuildConfig.DEBUG) LogLevel.DEBUG else LogLevel.INFO
Purchases.configure(
PurchasesConfiguration.Builder(this, BuildConfig.RC_API_KEY)
.appUserID(null) // or your stable user id
.build()
)
}
}
```
Register the class in `AndroidManifest.xml` with `android:name=".App"` on `<application>`. Keep the public Android SDK key out of source; inject it through `BuildConfig` or a secret manager.
### 3.3 Confirm the wiring with a minimal offerings fetch
From any coroutine scope after `configure` has run:
```kotlin
lifecycleScope.launch {
val offerings = Purchases.sharedInstance.awaitOfferings()
Log.d("RC", "current=${offerings.current?.identifier}")
}
```
A non-null `offerings.current` identifier means the API key, package name, and network path are working. If you see `null`, check the dashboard offering setup and the package name match before touching code.
## What the SDK handles for you
Once configured, you do not need to:
- Create or close a `BillingClient`
- Call `startConnection` or `endConnection`
- Check `isReady` or write reconnection logic for `SERVICE_DISCONNECTED`
- Call `queryPurchasesAsync` at launch; the SDK posts unfinished transactions automatically
## Common pitfalls
| Symptom | Likely cause |
| --- | --- |
| `IllegalStateException: There is no singleton instance` | Code touched `Purchases.sharedInstance` before `configure` ran. Move `configure` to `Application.onCreate`. |
| Offerings always `null` | Package name mismatch between Play Console and dashboard, or offering not marked current. |
| Duplicate anonymous users | `configure` called more than once per process, or an unstable id passed as `appUserID`. |
| Verbose logs in production | Log level not gated on `BuildConfig.DEBUG`. |
## References
- [Full chapter](https://www.revenuecat.com/guides/revenuecat-android-sdk/configuring-the-sdk)
© RevenueCat · MIT · RevenueCat/ai-toolkit