# RevenueCat統合の包括的なセットアップ 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を追加したい場合、またはパブリックAPIキーを使ってSDKを再設定したい場合。 このスキルは以下の2つのフェーズをカバーします:
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経由でプロジェクト一覧を取得し、ユーザーに確認する。ダッシュボードに触れる前に、以下の情報を収集してください:
Info.plist / AndroidManifest.xml / app.json / pubspec.yaml から取得すること。以下のツール呼び出しにはすべてRevenueCat MCPサーバーを使用すること。
list-projects — アクセス可能なプロジェクトを一覧表示する。複数ある場合は、このアプリに対応するプロジェクトをユーザーに確認するか、新規作成を提案する。create-revenuecat-project スキルに引き継ぎ、完了後ここへ戻ること。project_id を保持しておく。test_store アプリは必ず存在するが、app_store および play_store アプリはユーザーがストア側のセットアップを完了している場合のみ存在する。test_store アプリがあれば統合を開始するのに十分であることを安心させること。create-app を呼び出す:
type: "app_store"、セクション1で取得した bundle_id。type: "play_store"、セクション1で取得した package_name。name は識別子から導出するか、ユーザーに確認する。list-public-api-keys を呼び出す:
app_store / play_store。test_store アプリ。appl_…、Androidは goog_…、Amazonは amzn_…。シークレットAPIキーをクライアントコードに使用しないでください。 シークレットキーはサーバーサイド専用です。
作業ディレクトリを調べ、上から順に最初に一致したものを選択します:
package.json に react-native-purchases エントリがあるか、react-native が依存関係に含まれている → platforms/react-native.md を読む。expo も依存関係にある場合は、Expoプロジェクトとして記録する。pubspec.yaml が存在する → platforms/flutter.md を読む。build.gradle.kts に kotlin { … } マルチプラットフォームのソースセットブロックが含まれているか、com.revenuecat.purchases:purchases-kmp* に依存している → platforms/kmp.md を読む。build.gradle(.kts) に com.android.application が適用されている(かつKMPでない) → platforms/android.md を読む。Package.swift、*.xcodeproj、*.xcworkspace、または Podfile が存在する → platforms/ios.md を読む。複数が一致する場合(例: Flutterプロジェクト内の ios/ フォルダ)は、ビルドを管理する最も外側のプロジェクトを選択すること。
それでも曖昧な場合は、どのプラットフォームを設定するかユーザーに確認する。
appl_… キー、Androidアプリには goog_… キー(Amazonは amzn_…)を使用します。
サーバーサイドのシークレットキーはクライアントアプリに含めてはなりません。Purchases.configure(…) はできる限り早い段階(アプリのエントリーポイント)で、かつ1回だけ呼び出すこと。
それ以降の呼び出しは何もしないか、警告が出ます。appUserID を渡さない場合、RevenueCatは安定した匿名IDを自動生成します。
appUserID を渡すのは、起動時点ですでに認証済みユーザーがいる場合のみにすること。
そうでなければ、後から logIn(…) を呼び出してください(revenuecat-identify-user スキルを参照)。.env(RN)、xcconfig(iOS)、local.properties / gradle.properties(Android)、または dart-define(Flutter)を推奨すること。検出結果に対応するプラットフォームファイルを読むこと:
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.md各プラットフォームファイルは独立して完結しており、インストールコマンド・configure の正確なコードスニペット・アプリエントリーポイントへの配置場所が記載されています。
以下がすべて満たされるまで、セットアップ完了を宣言しないこと:
./gradlew assembleDebug、flutter run、npx react-native run-ios、またはKMP相当のコマンド)。ユーザーがアプリを実行せず「インストールするだけ」と言っている場合は、実際に実行したときにログで何を確認すべきかを伝えること。
プロジェクトにプロダクト、エンタイトルメント、オファリングがすでに設定されているか確認する。
設定されていない場合は、create-revenuecat-project スキルを通じてサポートを申し出ること。
iOS(App Store Connect)
.p8 ファイルをダウンロードする。Key IDとIssuer IDを記録しておく。create-app / update-app でRevenueCat側に登録する。Android(Google Play Console)
create-app / update-app で登録する。integrate-revenuecat の後によく使われるスキル:
revenuecat-paywall — ダッシュボードで設定したペイウォールを表示する。revenuecat-purchase-flow — 購入とリストアを手動で実装する。revenuecat-entitlements-gate — アクティブなエンタイトルメントの背後に機能をゲートする。revenuecat-identify-user — logIn / logOut をアプリの認証システムと連携させる。revenuecat-testing-setup — サンドボックステスト環境をセットアップする。revenuecat-troubleshoot — オファリング / プロダクト / エンタイトルメントのバグを診断する。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:
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.
Available as $ARGUMENTS when invoked as a slash command:
platform (optional): One of ios, 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.Before touching the dashboard, gather the facts:
Info.plist / AndroidManifest.xml / app.json / pubspec.yaml rather than asking.Use the RevenueCat MCP server for every tool call below.
list-projects — list accessible projects. If multiple, ask the user which one matches this app, or offer to create a new one.create-revenuecat-project skill, then resume here.project_id for the rest of the steps.test_store app is always present; app_store and play_store apps are present only if the user has finished store-side setup.test_store app is enough to start integrating.create-app:
type: "app_store", bundle_id from Section 1.type: "play_store", package_name from Section 1.name derived from the identifier or asked from the user.list-public-api-keys with the relevant app ID:
app_store / play_store if the store-side app exists.test_store app.appl_…, Android keys goog_…, Amazon amzn_….Never use the secret API key in client code. Secret keys are server-side only.
Inspect the working directory and pick the first match, from top to bottom:
package.json has a react-native-purchases entry, or react-native as a dependency → read platforms/react-native.md. If expo is also a dependency, note it as an Expo project.pubspec.yaml exists at the project root → read platforms/flutter.md.build.gradle.kts contains a kotlin { … } multiplatform source sets block, or depends on com.revenuecat.purchases:purchases-kmp* → read platforms/kmp.md.build.gradle(.kts) applies com.android.application (and is not KMP) → read platforms/android.md.Package.swift, *.xcodeproj, *.xcworkspace, or Podfile at the project root → read platforms/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.
appl_… key, Android apps use a goog_… key (Amazon uses amzn_…). Server-side secret keys must never appear in client apps.Purchases.configure(…) exactly once, as early as possible (app entry point). Later calls no-op or warn.appUserID, RevenueCat creates a stable anonymous ID. Only pass appUserID if you already have an authenticated user at launch; otherwise call logIn(…) later (see the revenuecat-identify-user skill)..env (RN), xcconfig (iOS), local.properties / gradle.properties (Android), or dart-define (Flutter) when the user asks about secret management.Read the platform file that matches detection:
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.mdEach platform file is self-contained: install command, exact configure snippet, and where to place it in the app entry point.
Do not claim setup is complete until:
./gradlew assembleDebug, flutter run, npx react-native run-ios, or the KMP equivalent).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.
Check whether products, entitlements, and offerings are already set up in the project. If not, offer to help via the create-revenuecat-project skill.
iOS (App Store Connect)
.p8 file. Note the Key ID and Issuer ID.create-app / update-app.Android (Google Play Console)
create-app / update-app.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 — wire logIn / logOut to the app's auth system.revenuecat-testing-setup — set up a sandbox testing channel.revenuecat-troubleshoot — diagnose offerings / products / entitlement bugs.原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。