RevenueCat Setup
revenuecat_setupSets up a RevenueCat v2 project idempotently: creates premium entitlement, subscription attachments, SDK key, and Supabase secret, with human approval for live writes.
Instructions
Idempotently set up the RevenueCat v2 project: premium entitlement, subscription attachments, SDK key and Supabase secret (live write, needs human approval).
Use when: after a human created the RC project, linked ASC and supplied the v2 key. Returns NEEDS_HUMAN if no project exists. For ASC plus RC in one pass use store_setup. Returns: {ok, entitlement, sdk_key_set, secrets} or an approval_required refusal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| v2_key | Yes | RevenueCat secret API v2 key (sk_...); used for this call only. | |
| bundle_id | Yes | App bundle identifier in reverse-DNS form, e.g. com.example.app. | |
| env_suffix | No | Suffix for secret names when several apps share one Supabase project, e.g. '_MYAPP'. | |
| approval_id | No | Approval id from a previous approval_required refusal; omit on the first call. The human approves out-of-band with `appfactory approve <id>`, then call again with the same arguments and this id. | |
| set_secrets | No | If true (default) also write the RevenueCat secrets to Supabase. | |
| supabase_ref | Yes | Supabase project ref that receives the RevenueCat secrets. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||