rc-configuring-the-sdk
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.
What this skill does
# 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)
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.