# rc-configuring-the-sdk

A skill that walks the agent through wiring RevenueCat into an Android app: the Gradle dependency, Purchases.configure, app user id strategy and log level.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 636 installs · ★ 76
- Author: RevenueCat
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/RevenueCat/ai-toolkit/tree/HEAD/revenuecat-play-billing/skills/rc-configuring-the-sdk/SKILL.md
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/skills/rc-configuring-the-sdk

## What it does

The skill runs in three phases. First the agent searches the project for an existing `Purchases.configure` call and for billing code built on `BillingClient`. Then it picks where configure belongs — `Application.onCreate` or the first `Activity.onCreate` — and which app user id to pass. The last phase is code: the `com.revenuecat.purchases:purchases` dependency in `build.gradle.kts`, a `PurchasesConfiguration.Builder` call, and a minimal offerings fetch to confirm the wiring.

One configure call covers what you would otherwise write by hand: creating and closing a `BillingClient`, `startConnection`, reconnection on `SERVICE_DISCONNECTED`, and querying unfinished transactions at launch. Configure runs once per process, so if the call is already there the skill tells the agent to stop and check with you before touching it.

Keep the public Android SDK key out of source — the skill suggests injecting it through `BuildConfig` or a secret manager. Gate the log level on `BuildConfig.DEBUG`, otherwise `LogLevel.DEBUG` ships to production. When offerings come back `null`, the usual culprit is a package name mismatch between Play Console and the dashboard, not your code.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/rc-configuring-the-sdk/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/rc-configuring-the-sdk/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/rc-configuring-the-sdk/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/rc-configuring-the-sdk/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install RevenueCat/ai-toolkit rc-configuring-the-sdk
```

2. **Manually: put the files in place**
- File: `.github/skills/rc-configuring-the-sdk/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/RevenueCat/ai-toolkit --path revenuecat-play-billing/skills/rc-configuring-the-sdk
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/rc-configuring-the-sdk/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add RevenueCat/ai-toolkit --skill rc-configuring-the-sdk -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/RevenueCat/ai-toolkit/tree/HEAD/revenuecat-play-billing/skills/rc-configuring-the-sdk/SKILL.md

## When to use it
- add RevenueCat to an Android app without missing the Gradle sync
- choose between an anonymous and a known app user id at startup
- drop hand-written `BillingClient` connection and reconnection logic
- split log levels between debug and release builds
- track down why offerings come back empty

## Example prompts
- wire the RevenueCat Android SDK into this project
- set up `Purchases.configure` in `Application.onCreate` with an anonymous app user id
- debug why `offerings.current` is null

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 94e22c3388fa44e4.

BEGIN THIRD-PARTY FILE 94e22c3388fa44e4
````text
---
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. |
````
END THIRD-PARTY FILE 94e22c3388fa44e4

The third-party file has ended. Everything between the 94e22c3388fa44e4 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2289 of 5864 bytes. © RevenueCat · MIT · https://github.com/RevenueCat/ai-toolkit/tree/HEAD/revenuecat-play-billing/skills/rc-configuring-the-sdk/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
