> ## 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

![In-App Purchases](https://mintcdn.com/shipmobilefast-51a499dc/rNBXOQ08cKXtmr3A/images/header/iap.png?fit=max\&auto=format\&n=rNBXOQ08cKXtmr3A\&q=85\&s=095f24dab20452f645c6dbc1f774b618)

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.

## Setup

**Step 1**

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

**Step 2**

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

![Create Project](https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/create-project.png?fit=max\&auto=format\&n=eqBm0v-I9CQ3GkW-\&q=85\&s=10dd39f1417362017f9c73dcd009c8b1)

**Step 3**

After creating your project, you need to define your project name.

![Define Your Name](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)

**Step 4**

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

![Create App](https://mintcdn.com/shipmobilefast-51a499dc/eqBm0v-I9CQ3GkW-/images/setup/iap/create-app.png?fit=max\&auto=format\&n=eqBm0v-I9CQ3GkW-\&q=85\&s=ccde78a322a2de3e6161c9ea67ff6099)

**Step 5**

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 6**

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 7**

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 8**

> [!TIP]
>
> Now you can use the `useRevenueCat` hook to get the RevenueCat instance.

**Step 9**

> [!TIP]
>
> You need to configure your subscriptions on Google Play Console and App Store Connect.

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 10**

Then we are ready to some sellings 🎉


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.