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

# Overview

> Overview of in-app purchases

<Frame>
  <img src="https://mintcdn.com/shipmobilefast-51a499dc/rNBXOQ08cKXtmr3A/images/header/iap.png?fit=max&auto=format&n=rNBXOQ08cKXtmr3A&q=85&s=095f24dab20452f645c6dbc1f774b618" alt="In-App Purchases" className="w-full h-full rounded-xl" width="700" height="320" data-path="images/header/iap.png" />
</Frame>

We are using [RevenueCat](https://www.revenuecat.com/) to handle in-app purchases.

* Relevant Links:  [RevenueCat Docs](https://www.revenuecat.com/docs)

<Warning>
  First, you need an Apple Developer & Google Play Developer Account to setup in-app purchases.
</Warning>

## Setup

<Steps>
  <Step>
    First, go to [RevenueCat](https://www.revenuecat.com/) and create a account.
  </Step>

  <Step>
    After you create your account, click on the `Create Project` button.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/create-project.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=10dd39f1417362017f9c73dcd009c8b1" alt="Create Project" className="w-full h-full rounded-xl" width="1920" height="511" data-path="images/setup/iap/create-project.png" />
    </Frame>
  </Step>

  <Step>
    After creating your project, you need to define your project name.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/define-your-name.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=a0f10dc0e4118270594cf3d4b2cb464f" alt="Define Your Name" className="w-full h-full rounded-xl" width="451" height="295" data-path="images/setup/iap/define-your-name.png" />
    </Frame>
  </Step>

  <Step>
    Then, we are continuing with the tabs for platform-specific setup.

    <Frame>
      <img src="https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/create-app.png?fit=max&auto=format&n=eqBm0v-I9CQ3GkW-&q=85&s=ccde78a322a2de3e6161c9ea67ff6099" alt="Create App" className="w-full h-full rounded-xl" width="1778" height="1144" data-path="images/setup/iap/create-app.png" />
    </Frame>
  </Step>

  <Step>
    After completing two platform-specific setup, open your `app/_layout.tsx` file.

    * Add the `RevenueCatProvider` component.

    ```tsx theme={null}
    import {
        RevenueCatProvider,
        useRevenueCat,
    } from '@/context/RevenueCatProvider';
    ```
  </Step>

  <Step>
    Find the `useEffect` hook in the `App` component.

    ```tsx theme={null}
    //* If you want to use RevenueCat, uncomment the following lines 👇
    const { initializeRevenueCat } = useRevenueCat();

    useEffect(() => {
        ....
        getUserTrackingPermission();
        // Uncomment the following line 👇
        initializeRevenueCat(); 
    }, []);
    ```
  </Step>

  <Step>
    Wrap the `RootLayout` component with the `RevenueCatProvider` component.

    ```tsx {5,7} theme={null}
    const RootLayout = () => {
      return (
        <Provider store={store}>
          <AuthProvider>
            <RevenueCatProvider>
              {/* ... */}
            </RevenueCatProvider>
          </AuthProvider>
        </Provider>
      );
    };
    ```
  </Step>

  <Step>
    <Check>
      Now you can use the `useRevenueCat` hook to get the RevenueCat instance.
    </Check>
  </Step>

  <Step>
    <Tip>
      You need to configure your subscriptions on Google Play Console and App Store Connect.
    </Tip>

    I could have added this step too, but this is too specific for your project.

    * I am giving you the links to the docs for Google Play Console and App Store Connect.
    * [Google Play Console](https://www.revenuecat.com/docs/getting-started/entitlements/android-products)
    * [App Store Connect](https://www.revenuecat.com/docs/getting-started/entitlements/ios-products)
  </Step>

  <Step>
    Then we are ready to some sellings 🎉
  </Step>
</Steps>
