> This page is part of the [Customer.io documentation](https://docs.customer.io). For the complete index, see [llms.txt](https://docs.customer.io/llms.txt).
> Last updated: November 16, 2026
> To take actions in Customer.io from an agent, use the [Customer.io CLI](https://docs.customer.io/ai/cli/get-started.md) or the [MCP server](https://docs.customer.io/ai/mcp/get-started.md).
> This page has tabbed examples for: iOS, Android. Add `?tab=<name>` to the URL to get only that tab, and repeat it for more than one, for example `?tab=ios&tab=android`.

# Quick start guide

Set up your integration with an AI agent

Connect your AI coding agent to Customer.io’s [MCP](https://docs.customer.io/ai/mcp/get-started/) or the [CLI](https://docs.customer.io/ai/cli/get-started/#setup-cli). When you add this integration in the Customer.io UI, you’ll see a prompt under **Set up with an agent** that you can pass to your coding agent. With the Customer.io MCP or CLI tools, these prompts can help you set up your integration with minimal effort.

## Setup process overview

React Native lets you build native mobile apps with JavaScript. Our React Native SDK helps you integrate Customer.io to `identify` people, `track` their activity, and send both push notifications and in-app messages.

1.  [Install the SDK.](#install)
2.  [Identify and Track](#identify-and-track)
3.  [Push Notifications](#push-notifications)
4.  [In-App](#in-app)

## 1\. Install the SDK

You need to add a new *React Native* connection in Customer.io to get your CDP API key. See [Get your CDP API key](https://docs.customer.io/integrations/sdk/react-native/getting-started/auth/#get-your-cdp-api-key) for details.

1.  Make sure you [set up your React Native environment ↗](https://reactnative.dev/docs/environment-setup) first. **You must use React Native 0.77 or later**.

2.  Open your terminal and go to your project folder.

3.  Install the `customerio-reactnative` package using NPM or Yarn:

    ```
    npm install customerio-reactnative
    # or
    yarn add customerio-reactnative
    ```

4.  Set up your project to support iOS and/or Android deployments:

    <!-- tabs -->

    <!-- tab: iOS -->

    #### iOS

    For iOS, install CocoaPods dependencies:

    ```
    pod install --repo-update --project-directory=ios
    ```

    Set your minimum iOS deployment target to `15.1` or later in both your `Podfile` and Xcode project settings.

    <!-- /tab -->

    <!-- tab: Android -->

    #### Android

    1.  For Android, include the Google Services plugin by adding the following to your project-level `android/build.gradle` file:

        ```
        buildscript {
            repositories {
              google()  // Google's Maven repository
            }

            dependencies {
              classpath 'com.google.gms:google-services:<version-here>'  // Google Services plugin
            }
        }

        allprojects {
            repositories {
              google()  // Google's Maven repository
            }
        }
        ```

    2.  Add the plugin to your app-level `android/app/build.gradle`:

        ```
        apply plugin: 'com.google.gms.google-services'  // Google Services plugin
        ```

    3.  Download `google-services.json` from your Firebase project and place it in `android/app/google-services.json`.

    <!-- /tab -->

    <!-- /tabs -->

5.  Add your *CDP API key* and *site ID* to your configuration.

    *   **CDP API Key**: You’ll find this key in your [*React Native* connection](https://fly.customer.io/workspaces/last/pipelines/sources).
    *   **Site ID**: You’ll find this value in your workspace under **[Settings > Workspace Settings > API and webhook credentials](https://fly.customer.io/workspaces/last/settings/api_credentials)**.
6.  Initialize the SDK in your app. Add the following code to your main component or App.js file:

    ```
    import React, { useEffect } from 'react';
    import {
      CioConfig,
      CioRegion,
      CioLogLevel,
      CustomerIO,
      PushClickBehaviorAndroid
    } from 'customerio-reactnative';

    useEffect(() => {
      const initializeCustomerIO = async () => {
        const config: CioConfig = {
          cdpApiKey: 'YOUR_CDP_API_KEY', // Required
          region: CioRegion.US, // Replace with CioRegion.EU if your Customer.ioaccount is in the EU
          logLevel: CioLogLevel.Debug,
          trackApplicationLifecycleEvents: true,
          inApp: {
            siteId: 'YOUR_SITE_ID', // Required for in-app messaging
          }
        };
        await CustomerIO.initialize(config);
      };
      initializeCustomerIO();
    }, []);
    ```

7.  Run your application to ensure everything is set up correctly:

    *   **iOS**: `npx react-native run-ios`
    *   **Android**: `npx react-native run-android`

Also track location and geofences

Want to react when someone enters or leaves a real-world place—a store, a venue, a neighborhood? The SDK’s Location and Geofence modules do that. They need location permissions and some native setup, so they aren’t part of the steps above. See [geofencing](https://docs.customer.io/integrations/sdk/react-native/tracking/geofencing/) to get started, or the [packages and configuration reference](https://docs.customer.io/integrations/sdk/react-native/getting-started/packages-options/) for every option.

## 2\. Identify and Track

1.  Identify a user in your app using the `CustomerIO.identify` method. You *must* identify a user before you can send push notifications and personalized in-app messages.

    ```
    import { CustomerIO } from "customerio-reactnative";

    const identifyUserExample = async () => {
      await CustomerIO.identify({
        userId: 'react-native-test-user@example.com',
        traits: {
          firstName: 'John',
          lastName: 'Doe',
          email: 'react-native-test-user@example.com',
          subscriptionStatus: 'active',
        },
      });
      console.log('User identified successfully');
    };
    ```

2.  Track a custom event using the `CustomerIO.track` method. Events help you trigger personalized automations and track user activity.

    ```
    import { CustomerIO } from "customerio-reactnative";

    const trackCustomEventExample = async () => {
      await CustomerIO.track('purchased_item', {
        product: 'Premium Subscription',
        price: 99.99,
        currency: 'USD'
      });
      console.log('Custom event tracked successfully');
    };
    ```

3.  Track screen views to trigger in-app messages associated with specific screens.

    ```
    import { CustomerIO } from "customerio-reactnative";

    const trackScreenViewExample = async () => {
      await CustomerIO.screen('ProductDetails');
      console.log('Screen view tracked successfully');
    };
    ```

## 3\. Push Notifications

1.  Set up your push notification credentials in Customer.io:

    *   **iOS**: [Upload your Apple Push Notification certificate](https://fly.customer.io/workspaces/last/settings/actions/push/ios) (.p8 file).
    *   **Android**: [Upload your Firebase Cloud Messaging server key](https://fly.customer.io/workspaces/last/settings/actions/push/android) (.json format).
2.  Request push notification permissions from the user:

    ```
    import { CustomerIO, CioPushPermissionStatus } from "customerio-reactnative";

    const requestPushPermissions = async () => {
      const permissionStatus = await CustomerIO.pushMessaging.showPromptForPushNotifications({
        ios: {
          sound: true,
          badge: true
        }
      });

      switch (permissionStatus) {
        case CioPushPermissionStatus.Granted:
          console.log('Push notifications enabled');
          break;
        case CioPushPermissionStatus.Denied:
        case CioPushPermissionStatus.NotDetermined:
          console.log('Push notifications denied');
          break;
      }
    };
    ```

3.  For iOS: to ensure that metrics are tracked, configure Background Modes. In Xcode, enable “Remote notifications” under Capabilities > Background Modes.

4.  For Android: add notification icon resources:

    *   Place a notification icon file named `ic_notification.png` in your drawable folders.
    *   Make sure your app’s `AndroidManifest.xml` has the proper FCM permissions.

## 4\. In-App

1.  To enable in-app messaging, all you need to do is add the site ID. Remember, you’ll find your site ID under **[Integrations > Customer.io API: Track](https://fly.customer.io/workspaces/last/settings/api_credentials)** in the *Connections* tab.

2.  Ensure that the SDK is initialized with the site ID in your app. You can call the `initialize` method from your components or services:

```
import { CioConfig, CustomerIO } from "customerio-reactnative";
import { useEffect } from "react";

useEffect(() => {
  const initializeCustomerIO = async () => {
    const config: CioConfig = {
      cdpApiKey: 'YOUR_CDP_API_KEY',
      inApp: {
        siteId: 'YOUR_SITE_ID',
      }
    };

    await CustomerIO.initialize(config);
  };
  initializeCustomerIO();
}, []);
```

Check out our code samples!

You’ll find a complete, working sample app in our [React Native SDK’s example directory ↗](https://github.com/customerio/customerio-reactnative/tree/main/example). If you get stuck, you can refer to the sample app to see how everything fits together.
