💰integrate-revenuecat
- プラグイン
- rc
- ソース
- GitHub で見る ↗
説明
RevenueCatのエンドツーエンド統合 — RevenueCat MCP経由でダッシュボード側のセットアップ(プロジェクト、アプリ、公開APIキー)を行い、アプリへのPurchases SDKのインストールおよび設定を実施します。 次のような場合に使用: ユーザーがRevenueCatの追加、Purchasesの統合、RevenueCat SDKのインストール、RevenueCat APIキーのセットアップ、起動時のPurchasesの設定、またはiOS・Android・Kotlin Multiplatform・Flutter・React NativeでのRevenueCat新規統合のセットアップを要求した場合。
原文を表示
End-to-end RevenueCat integration — sets up the dashboard side via the RevenueCat MCP (project, app, public API key) and installs/configures the Purchases SDK in the app. Use when the user asks to add RevenueCat, integrate Purchases, install the RevenueCat SDK, set up a RevenueCat API key, configure Purchases on launch, or set up a brand new RevenueCat integration on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.
ユースケース
- ✓RevenueCatを新規に追加するとき
- ✓Purchases SDKをインストール・設定するとき
- ✓RevenueCat APIキーをセットアップするとき
- ✓iOS・Android等でRevenueCat統合するとき
- ✓起動時のPurchases設定を実施するとき
本文(日本語訳)
integrate-revenuecat: RevenueCatのエンドツーエンド統合
次のような場合に使用:
- ユーザーがプロジェクトに初めてRevenueCatを追加したいとき
- 公開APIキーを使ってSDKを再設定したいとき
このスキルは2つのパートで構成されます:
- ダッシュボード側 — RevenueCat MCPサーバーを通じて、プロジェクトのセットアップ、アプリの登録、公開APIキーの取得を行う。
- アプリ側 — Purchases SDKのインストール、アプリエントリーポイントでの
Purchases.configure(…)の呼び出し、ログ上の設定確認バナーの検証を行う。
上記の順番で進めること。「SDKをインストールするだけでよい」とユーザーが言っている場合でも、ほとんどの統合では両方のパートが必要です — SDKにはダッシュボードで取得したAPIキーが必要なためです。
プロジェクトとアプリがすでに存在しており、SDKをコードに組み込むだけでよい場合は、下記の セクション3 にジャンプしてください。 まったく新しいRevenueCatプロジェクト(アプリ・プロダクト・エンタイトルメント・オファリングを含む)をゼロから構築したい場合は、代わりに
create-revenuecat-projectスキルを使用し、その後SDKインストールのためにここに戻ってきてください。
引数
スラッシュコマンドとして呼び出す際、$ARGUMENTS として利用可能:
platform(任意):ios、android、kmp、flutter、react-nativeのいずれか。省略した場合は、セクション3aの検出アルゴリズムを実行する。app_identifier(任意): バンドルID(iOS)またはパッケージ名(Android)。省略した場合は、プロジェクトファイル(Info.plist、AndroidManifest.xml、app.json、pubspec.yaml)から読み取る。project_name(任意): 使用するRevenueCatプロジェクトの名前。省略した場合は、MCPでプロジェクト一覧を取得してユーザーに確認する。
1. 現状の把握
ダッシュボードに触れる前に、以下の情報を収集する:
- プラットフォームターゲット: iOS / Apple App Store、Android / Google Play、またはその両方。確認を求める前に作業ディレクトリを確認すること — セクション3の検出アルゴリズムで、ほとんどのプロジェクトは明確に判別できる。
- テクノロジー: ネイティブiOS(Swift)、ネイティブAndroid(Kotlin / Java)、React Native、Flutter、Kotlin Multiplatform。SDKの一覧: https://www.revenuecat.com/docs/getting-started/installation.md
- アプリ識別子: バンドルID(iOS)、パッケージ名(Android)。ユーザーに確認するのではなく、
Info.plist/AndroidManifest.xml/app.json/pubspec.yamlから取得する。
2. ダッシュボード側 — RevenueCat MCP
以下のすべてのツール呼び出しにはRevenueCat MCPサーバーを使用する。
2a. プロジェクトの取得または作成
list-projects— アクセス可能なプロジェクトを一覧表示する。複数ある場合は、このアプリに対応するプロジェクトをユーザーに選んでもらうか、新規作成を提案する。- プロジェクトが存在しない場合は、
create-revenuecat-projectスキルに引き渡してから、ここに戻る。 - 以降のステップのために
project_idを保持する。
2b. アプリの取得または作成
- プロジェクトにすでに設定されているアプリを確認する。
test_storeアプリは常に存在するが、app_storeおよびplay_storeアプリはストア側のセットアップが完了している場合にのみ存在する。 - ストア側のセットアップ(App Store Connect(iOS)またはGoogle Play Console(Android))が完了しているかをユーザーに確認する。ストア側のセットアップは後からでも可能であり、
test_storeアプリだけで統合を始められる旨を伝えて安心させること。 - ストア側のセットアップが完了していることをユーザーが確認した場合、
create-appを呼び出す:- iOS:
type: "app_store"、セクション1で取得したbundle_id。 - Android:
type: "play_store"、セクション1で取得したpackage_name。 nameは識別子から導出するか、ユーザーに確認する。
- iOS:
2c. 公開APIキーの取得
- 該当するアプリIDを指定して
list-public-api-keysを呼び出す:- ストア側アプリが存在する場合は
app_store/play_store。 - 存在しない場合は
test_storeアプリ。
- ストア側アプリが存在する場合は
- 返されるキーは 公開キー であり、クライアントアプリのコードに埋め込んでも安全。iOSキーのプレフィックスは
appl_…、Androidキーはgoog_…、Amazonキーはamzn_…。
シークレットAPIキーはクライアントコードに絶対に使用しないこと。 シークレットキーはサーバーサイド専用です。
3. アプリ側 — SDKのインストールと設定
3a. プラットフォームの検出
作業ディレクトリを確認し、上から順に 最初に一致したもの を採用する:
- React Native:
package.jsonにreact-native-purchasesエントリがある、またはreact-nativeが依存関係に含まれている →platforms/react-native.mdを読む。expoも依存関係にある場合は、Expoプロジェクトとして記録する。 - Flutter: プロジェクトルートに
pubspec.yamlが存在する →platforms/flutter.mdを読む。 - Kotlin Multiplatform:
build.gradle.ktsにkotlin { … }マルチプラットフォームソースセットブロックが含まれているか、com.revenuecat.purchases:purchases-kmp*に依存している →platforms/kmp.mdを読む。 - Android(ネイティブ):
build.gradle(.kts)がcom.android.applicationを適用している(KMPでない場合)→platforms/android.mdを読む。 - iOS(ネイティブ): プロジェクトルートに
Package.swift、*.xcodeproj、*.xcworkspace、またはPodfileが存在する →platforms/ios.mdを読む。
複数一致する場合(例: Flutterプロジェクト内に ios/ フォルダがある場合)は、ビルドを所有する 最も外側の プロジェクトを選ぶ。それでも判断できない場合は、どのプラットフォームを設定したいかユーザーに確認する。
3b. 共通の概念(全プラットフォーム共通)
- 公開SDKキー(シークレットキーではない)。 RevenueCatはストア/プラットフォームごとに個別の公開SDKキーを発行する。iOSアプリは
appl_…キー、Androidアプリはgoog_…キー(Amazonはamzn_…)を使用する。サーバーサイドのシークレットキーはクライアントアプリに絶対に含めてはならない。 - アプリ起動ごとに1回だけ設定する。
Purchases.configure(…)は、できるだけ早い段階(アプリのエントリーポイント)で、正確に1回だけ呼び出す。2回目以降の呼び出しは無視されるか警告が出る。 - デフォルトは匿名ユーザー。
appUserIDを渡さない場合、RevenueCatは安定した匿名IDを生成する。appUserIDを渡すのは、起動時にすでに認証済みユーザーが存在する場合のみ。それ以外は後からlogIn(…)を呼び出すこと(revenuecat-identify-userスキルを参照)。 - 統合中はデバッグログを有効にする。 各プラットフォームのファイルに方法が記載されている。リリースビルドではオフにすること。
- キーをソース管理に含めない。 シークレット管理についてユーザーが質問した場合は、
.env(React Native)、xcconfig(iOS)、local.properties/gradle.properties(Android)、dart-define(Flutter)を推奨する。
3c. 実装
検出結果に対応するプラットフォームファイルを読む:
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.md
各プラットフォームファイルは自己完結型で、インストールコマンド、正確な configure スニペット、およびアプリエントリーポイントへの配置場所が記載されている。
4. 動作確認
以下がすべて完了するまで、セットアップ完了を宣言しないこと:
- プロジェクトが ビルドできる(Xcodeビルド、
./gradlew assembleDebug、flutter run、npx react-native run-ios、またはKMP相当のコマンド)。 - アプリが起動し、RevenueCat SDKがコンソール / logcat / Metroの出力に設定確認バナーをログ出力する(期待されるログの内容は各プラットフォームファイルに記載)。
- 最初のSDKネットワーク呼び出しで認証エラーが発生しない。APIキーが誤っている場合は、アプリがオファリングを取得しようとした直後に認証エラーがログに表示される。
アプリを実行せずに「インストールだけ」を求めていたユーザーには、実際に実行した際にログで確認すべき内容を伝えること。
5. 次のステップ
5a. プロダクト・エンタイトルメント・オファリング
プロジェクトにプロダクト、エンタイトルメント、オファリングがすでに設定されているか確認する。設定されていない場合は、create-revenuecat-project スキルを通じてサポートを申し出る。
5b. ストア側のセットアップ
iOS(App Store Connect)
- In-App Purchaseキー(StoreKit 2推奨) — App Store Connect → ユーザーとアクセス → 統合 → アプリ内課金。キーを生成し、
.p8ファイルをダウンロードする。キーIDと発行者IDを記録する。 - Shared Secret(従来のStoreKit 1) — App Store Connect → アプリ → App情報 → App固有の共有シークレット。
- ユーザーがこの情報を提供した場合は、
create-app/update-appを通じてRevenueCat側に登録する。
Android(Google Play Console)
- サービスアカウントの認証情報 — Google Cloud ConsoleでService Accountを作成する。「Service Account User」ロールを付与する。JSONキーを作成する。Play Consoleで、「財務データの閲覧」権限を付与してService Accountにアクセスを許可する。
- リアルタイム開発者通知(RTDN) — Cloud Pub/Subトピックをセットアップする。Play Console → 収益化の設定で構成する。
- ユーザーがこの情報を提供した場合は、
create-app/update-appを通じて登録する。
5c. 後続のスキル
integrate-revenuecat 実行後によく使われる後続スキル:
revenuecat-paywall— ダッシュボードで設定したペイウォールを表示する。revenuecat-purchase-flow— 購入とリストアを手動で実装する。revenuecat-entitlements-gate— アクティブなエンタイトルメントに基づいて機能を制限する。revenuecat-identify-user— アプリの認証システムにlogIn/logOutを連携させる。revenuecat-testing-setup— サンドボックステスト環境をセットアップする。revenuecat-troubleshoot— オファリング / プロダクト / エンタイトルメントの不具合を診断する。
原文(English)を表示
integrate-revenuecat: end-to-end RevenueCat integration
Use this skill when the user wants to add RevenueCat to a project for the first time, or to reconfigure the SDK with a public API key. The skill covers two halves:
- Dashboard side — set up the project, register the app, and obtain the public API key, all through the RevenueCat MCP server.
- App side — install the Purchases SDK, call
Purchases.configure(…)at app entry, and verify the configuration banner in the logs.
Walk them in order. Most integrations need both halves, even when the user asks "just install the SDK" — the SDK needs an API key from the dashboard.
If a project + app already exist and the user only wants to wire the SDK into code, jump to Section 3 below. If the user wants to bootstrap a brand new RevenueCat project (apps + products + entitlements + offerings), use the
create-revenuecat-projectskill instead, then come back here for the SDK install.
Arguments
Available as $ARGUMENTS when invoked as a slash command:
platform(optional): One ofios,android,kmp,flutter,react-native. If omitted, run the detection algorithm in Section 3a.app_identifier(optional): Bundle ID (iOS) or package name (Android). If omitted, read it from the project files (Info.plist,AndroidManifest.xml,app.json,pubspec.yaml).project_name(optional): Name of the RevenueCat project to use. If omitted, list projects via MCP and ask the user.
1. Understand the status quo
Before touching the dashboard, gather the facts:
- Platform target: iOS / Apple App Store, Android / Google Play, or both. Inspect the working directory before asking — the detection algorithm in Section 3 makes this obvious for most projects.
- Technology: native iOS (Swift), native Android (Kotlin / Java), React Native, Flutter, Kotlin Multiplatform. SDK list: https://www.revenuecat.com/docs/getting-started/installation.md.
- App identifier: bundle ID (iOS), package name (Android). Pull from
Info.plist/AndroidManifest.xml/app.json/pubspec.yamlrather than asking.
2. Dashboard side — RevenueCat MCP
Use the RevenueCat MCP server for every tool call below.
2a. Get or create the project
list-projects— list accessible projects. If multiple, ask the user which one matches this app, or offer to create a new one.- If there is no project, hand off to the
create-revenuecat-projectskill, then resume here. - Store the
project_idfor the rest of the steps.
2b. Get or create the app
- Check which apps are already configured in the project. A
test_storeapp is always present;app_storeandplay_storeapps are present only if the user has finished store-side setup. - Ask the user whether their app is already set up in App Store Connect (iOS) or Google Play Console (Android). Reassure them that store-side setup can come later — the
test_storeapp is enough to start integrating. - If the user confirms store-side setup is done, call
create-app:- iOS:
type: "app_store",bundle_idfrom Section 1. - Android:
type: "play_store",package_namefrom Section 1. namederived from the identifier or asked from the user.
- iOS:
2c. Get the public API key
- Call
list-public-api-keyswith the relevant app ID:app_store/play_storeif the store-side app exists.- Otherwise the
test_storeapp.
- The returned key is public and safe to embed in client app code. iOS keys are prefixed
appl_…, Android keysgoog_…, Amazonamzn_….
Never use the secret API key in client code. Secret keys are server-side only.
3. App side — install and configure the SDK
3a. Detect the platform
Inspect the working directory and pick the first match, from top to bottom:
- React Native:
package.jsonhas areact-native-purchasesentry, orreact-nativeas a dependency → readplatforms/react-native.md. Ifexpois also a dependency, note it as an Expo project. - Flutter:
pubspec.yamlexists at the project root → readplatforms/flutter.md. - Kotlin Multiplatform:
build.gradle.ktscontains akotlin { … }multiplatform source sets block, or depends oncom.revenuecat.purchases:purchases-kmp*→ readplatforms/kmp.md. - Android (native):
build.gradle(.kts)appliescom.android.application(and is not KMP) → readplatforms/android.md. - iOS (native):
Package.swift,*.xcodeproj,*.xcworkspace, orPodfileat the project root → readplatforms/ios.md.
If several match (e.g. an ios/ folder inside a Flutter project), pick the outermost project, the one that owns the build. If still ambiguous, ask the user which platform they want to configure.
3b. Shared concepts (all platforms)
- Public SDK key, not secret key. RevenueCat issues a separate public SDK key per store/platform. iOS apps use an
appl_…key, Android apps use agoog_…key (Amazon usesamzn_…). Server-side secret keys must never appear in client apps. - Configure once per app launch. Call
Purchases.configure(…)exactly once, as early as possible (app entry point). Later calls no-op or warn. - Anonymous users by default. If you don't pass an
appUserID, RevenueCat creates a stable anonymous ID. Only passappUserIDif you already have an authenticated user at launch; otherwise calllogIn(…)later (see therevenuecat-identify-userskill). - Enable debug logging during integration. Each platform file shows how. Turn it off for release builds.
- Keep keys out of source control. Recommend
.env(RN),xcconfig(iOS),local.properties/gradle.properties(Android), or dart-define (Flutter) when the user asks about secret management.
3c. Implementation
Read the platform file that matches detection:
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.md
Each platform file is self-contained: install command, exact configure snippet, and where to place it in the app entry point.
4. Verify
Do not claim setup is complete until:
- The project builds (Xcode build,
./gradlew assembleDebug,flutter run,npx react-native run-ios, or the KMP equivalent). - The app launches and the RevenueCat SDK logs a configuration banner in the console / logcat / Metro output (each platform file describes the expected log line).
- No authentication errors appear on the first SDK network call. A wrong API key surfaces as an auth error log as soon as the app fetches offerings.
If the user only asked to "install" without running the app, tell them what to look for in the logs when they do run it.
5. Next steps
5a. Products, entitlements, offerings
Check whether products, entitlements, and offerings are already set up in the project. If not, offer to help via the create-revenuecat-project skill.
5b. Store-side setup
iOS (App Store Connect)
- In-App Purchase Key (recommended for StoreKit 2) — App Store Connect → Users and Access → Integrations → In-App Purchase. Generate key, download the
.p8file. Note the Key ID and Issuer ID. - Shared Secret (legacy StoreKit 1) — App Store Connect → App → App Information → App-Specific Shared Secret.
- If the user provides this information, register it on the RevenueCat side via
create-app/update-app.
Android (Google Play Console)
- Service account credentials — Create a service account in Google Cloud Console. Grant "Service Account User" role. Create a JSON key. In Play Console, grant the service account access with "View financial data" permission.
- Real-time Developer Notifications (RTDN) — Set up a Cloud Pub/Sub topic. Configure in Play Console → Monetization setup.
- If the user provides this information, register it via
create-app/update-app.
5c. Subsequent skills
Common follow-ups after integrate-revenuecat:
revenuecat-paywall— display a dashboard-configured paywall.revenuecat-purchase-flow— implement purchase + restore manually.revenuecat-entitlements-gate— gate features behind active entitlements.revenuecat-identify-user— wirelogIn/logOutto the app's auth system.revenuecat-testing-setup— set up a sandbox testing channel.revenuecat-troubleshoot— diagnose offerings / products / entitlement bugs.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。