> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RevenueCat Subscriptions

> Learn how to add in-app subscriptions to your mobile app with RevenueCat using Agent.

export const AiPrompt = ({children}) => {
  return <CodeBlock className="relative block font-sans whitespace-pre-wrap break-words">
      <div className="pr-7">
        {children}
      </div>
    </CodeBlock>;
};

## What is RevenueCat

RevenueCat allows you to add in-app subscriptions to your [native mobile app](/replitai/building-mobile-apps). To get started, ask Agent to set up a subscription, connect your RevenueCat account, and Agent handles the logic and provides a test environment.

## Prerequisites

Before you start, you need:

* A Replit project created with a **Mobile app**
* A [RevenueCat](https://www.revenuecat.com) account (only an email and password are required—no bank account or additional setup needed)

## Get started

<Steps>
  <Step title="Ask Agent to add a subscription">
    Describe the subscription you want. Agent plans the integration, installs packages, and sets up RevenueCat.

    <AiPrompt>Add a \$5.99/mo subscription to my app</AiPrompt>

    <Frame>
      <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-prompt.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=1f5aef4b09f4ba1a20eb982e2db87f12" alt="Replit Project Editor showing Agent responding to a prompt to add a subscription" width="1957" height="1133" data-path="images/replitai/revenuecat-prompt.png" />
    </Frame>
  </Step>

  <Step title="Connect your RevenueCat account">
    Agent prompts you to connect RevenueCat. Select **Connect RevenueCat** to begin the authorization flow.

    <Frame>
      <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-connect.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=2ab15e61163cb1a499b5082338efb5db" alt="Agent chat showing the Connect RevenueCat banner with a Connect button" width="1957" height="1133" data-path="images/replitai/revenuecat-connect.png" />
    </Frame>

    A modal confirms you are connecting to RevenueCat. Select **Continue to RevenueCat** to proceed.

    <Frame>
      <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-connect-modal.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=b901785b4dc04548f826fe84ea0447f0" alt="Connect RevenueCat modal showing privacy and security information" width="1957" height="1133" data-path="images/replitai/revenuecat-connect-modal.png" />
    </Frame>
  </Step>

  <Step title="Authorize Replit">
    On the RevenueCat authorization page, select **Read & Write** access and then **Authorize** to grant Replit access to your RevenueCat account.

    <Frame>
      <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-authorize.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=ef7c653c14f864265f6157a35cc62800" alt="RevenueCat OAuth authorization page with Read and Write access selected" width="683" height="897" data-path="images/replitai/revenuecat-authorize.png" />
    </Frame>
  </Step>

  <Step title="Agent builds your subscription">
    After authorization, Agent creates the RevenueCat project, configures products and entitlements, builds a paywall screen, and wires up subscription logic throughout your app.

    <Frame>
      <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-agent-summary.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=1343a44680e387548c7811c4ffae2be1" alt="Agent summary showing the paywall screen with subscription features and pricing" width="1957" height="1133" data-path="images/replitai/revenuecat-agent-summary.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-app-home.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=20f7a373137adbee146010b795824560" alt="Mobile app home screen showing a Premium badge for subscribed content" width="1957" height="1133" data-path="images/replitai/revenuecat-app-home.png" />
    </Frame>
  </Step>
</Steps>

## Test subscriptions

Replit previews use RevenueCat's **test mode**. When you test a purchase in Expo Go, you see a test purchase dialog instead of a real payment flow. No money is charged.

<Frame>
  <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-test-purchase.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=cd4d96400d7176eefe69e8762f89c425" alt="Test purchase dialog on a mobile device showing package details and test buttons" width="683" height="1253" data-path="images/replitai/revenuecat-test-purchase.png" />
</Frame>

<Tip>
  Test purchases are safe to use during development. You can test both
  successful and failed purchase flows without any real charges.
</Tip>

<Warning>
  Once your app is published to the App Store, purchases use real money. Make
  sure your RevenueCat products and pricing are correct before submitting to the
  App Store.
</Warning>

## Manage subscriptions

To modify your subscription, ask Agent. For example:

<AiPrompt>Modify the subscription to be \$9.99/yr instead</AiPrompt>

Agent updates your RevenueCat product configuration, paywall UI, and subscription logic to reflect the change.

<Frame>
  <img src="https://mintcdn.com/replit/54Lx5jKPhNuBhNIa/images/replitai/revenuecat-modify.png?fit=max&auto=format&n=54Lx5jKPhNuBhNIa&q=85&s=1f2e3540744cff1d9626ca9ff065abbb" alt="Replit Project Editor showing Agent modifying the subscription price from monthly to yearly" width="1957" height="1133" data-path="images/replitai/revenuecat-modify.png" />
</Frame>

## Syncing to App Store Connect

For in-app purchases to work in TestFlight and the Apple App Store, [you'll need to agree
to Apple's Paid Apps Agreement and connect your bank account](https://developer.apple.com/help/app-store-connect/manage-agreements/sign-and-update-agreements/).
This is done through App Store Connect. You'll need a paid Apple Developer Account. This is required if you want to publish your app to the App Store.

Afterwards, you can sync your in-app purchases configurations from RevenueCat to App Store Connect directly through Replit.

<Steps>
  <Step title="Go to the Manage pane in Publishing">
    You'll see a button to sync RevenueCat to App Store Connect.

    <Frame>
      <img src="https://mintcdn.com/replit/xEOEB_NKh1DJyjhm/images/replitai/revenuecat-asc-sync-btn.png?fit=max&auto=format&n=xEOEB_NKh1DJyjhm&q=85&s=739b8603ed165eebf67a87ff5408da9b" alt="Sync RevenueCat to App Store Connect button" width="1476" height="604" data-path="images/replitai/revenuecat-asc-sync-btn.png" />
    </Frame>

    <Tip>
      This section will only show up once you have published your app to TestFlight.
    </Tip>
  </Step>

  <Step title="Provide App Store Connect API key">
    You'll need to go to App Store Connect to provide this key.

    In [App Store Connect](https://appstoreconnect.apple.com/access/integrations/api), go to **Users and Access**, then select the **Integrations** tab. In the sidebar, select **App Store Connect API**.

    When creating a key, be sure to give the key "App Manager" permissions.

    Download the .p8 file now—you can only download it once. The filename starts with `AuthKey_` and ends in `.p8`.

    Copy the **Key ID** and **Issuer ID** shown on this page.

    <Frame>
      <img src="https://mintcdn.com/replit/xEOEB_NKh1DJyjhm/images/replitai/revenuecat-asc-create.png?fit=max&auto=format&n=xEOEB_NKh1DJyjhm&q=85&s=24ac192da8b1182d1835ef4de0f9839a" alt="App Store Connect Users and Access page with numbered steps highlighting the Integrations tab, App Store Connect API sidebar link, and the plus button to create a new API key" width="2390" height="752" data-path="images/replitai/revenuecat-asc-create.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/replit/xEOEB_NKh1DJyjhm/images/replitai/revenuecat-asc-app-manager.png?fit=max&auto=format&n=xEOEB_NKh1DJyjhm&q=85&s=1cce1eda00a2aca593f7f1388c85b7b9" alt="Generate API Key dialog in App Store Connect with the name set to RevenueCat and Access set to App Manager" width="1116" height="560" data-path="images/replitai/revenuecat-asc-app-manager.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/replit/xEOEB_NKh1DJyjhm/images/replitai/revenuecat-asc-copy.png?fit=max&auto=format&n=xEOEB_NKh1DJyjhm&q=85&s=c2db4fb91a7ce8c49db0ae16603b61d8" alt="App Store Connect API keys page with arrows pointing to the Issuer ID Copy link and the Key ID column" width="2330" height="780" data-path="images/replitai/revenuecat-asc-copy.png" />
    </Frame>
  </Step>

  <Step title="Create an In-App Purchase API key">
    Repeat the previous step for an In-App Purchase API key.
    In the sidebar, select **In-App Purchase**. Then create an API key with **App Manager** permissions.
    Download the .p8 key (filename starts with `SubscriptionKey_` and ends in `.p8`). Copy the **Key ID** and **Issuer ID**.

    <Frame>
      <img src="https://mintcdn.com/replit/xEOEB_NKh1DJyjhm/images/replitai/revenuecat-iap-api-key.png?fit=max&auto=format&n=xEOEB_NKh1DJyjhm&q=85&s=6adeb76b34f36ab2528c614509727a77" alt="App Store Connect Users and Access page with In-App Purchase selected in the sidebar and an arrow pointing to the plus button to create a new key" width="2272" height="637" data-path="images/replitai/revenuecat-iap-api-key.png" />
    </Frame>
  </Step>

  <Step title="Sync Products">
    Confirm the list of products and sync to App Store Connect.

    <Frame>
      <img src="https://mintcdn.com/replit/xEOEB_NKh1DJyjhm/images/replitai/revenuecat-asc-products-sync.png?fit=max&auto=format&n=xEOEB_NKh1DJyjhm&q=85&s=009172881129e77b4fe8021bd19f98fb" alt="Manage in-app purchases dialog showing a Monthly Subscription product with price, duration, and territory fields, and a Sync to App Store Connect button" width="948" height="476" data-path="images/replitai/revenuecat-asc-products-sync.png" />
    </Frame>
  </Step>
</Steps>

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Do I need a bank account to use RevenueCat?">
    No. You only need an email and password to create a RevenueCat account. Bank
    account setup is handled separately through Apple or Google when you are
    ready to receive payouts from the App Store or Google Play.
  </Accordion>

  <Accordion title="Are test purchases charged?">
    No. During development, Replit previews use RevenueCat's test mode.
    Purchases are simulated and no real charges are made. Real charges only
    apply after your app is published to the App Store.
  </Accordion>

  <Accordion title="Can I use RevenueCat with a web app?">
    RevenueCat is designed for native mobile apps. To add subscriptions to a web
    app, use the [Stripe integration](/core-concepts/monetization/stripe-payments)
    instead.
  </Accordion>

  <Accordion title="What can I configure with RevenueCat?">
    You can set up monthly or yearly subscriptions, configure pricing, manage
    entitlements, and build paywalls. Ask Agent to make changes—it handles both
    the RevenueCat configuration and your app code.
  </Accordion>
</AccordionGroup>
