---
updatedAt: 2026-04-15T04:44:18.000Z
agentTools:
  projectIndex: https://docs.webengage.com/llms.txt
---

# React Native

[React Native](https://facebook.github.io/react-native/) lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components.

**Here's how you can integrate the WebEngage SDK with your react native apps:**

## 1. Install WebEngage React Native Library

Use the below command in your project directory to install WebEngage React Native library.

```shell npm
npm install react-native-webengage --save
```
```Text yarn
yarn add react-native-webengage
```

## 2. Install Android SDK

**Step 2.1:** For setting up your Android application, refer to the [Initialization](https://docs.webengage.com/docs/android-getting-started#2-initialization) instructions to utilize the Android SDK. You can bypass Step 1 - Installation and proceed directly to Step 2.

<Image align="center" width="450px" src="https://files.readme.io/24cce8f-android_integration.png" />

<Callout icon="⚠️" theme="warn">
  Ensure that you finish the [Android Integration](https://docs.webengage.com/docs/android-getting-started#2-initialization) steps before proceeding with the step below.
</Callout>

**Step 2.2:** After completion of Android Integration proceed with the following step

```java
import com.webengage.WebengageBridge;

@Override
public void onCreate() {
  super.onCreate();
  WebengageBridge.getInstance();        // Add This
  //...WebEngage initialization
  WebEngageConfig webEngageConfig = new WebEngageConfig.Builder()
       .setWebEngageKey(YOUR_WEBENGAGE_LICENSE_CODE)
       .setDebugMode(true) // only in development mode
       .build();
  registerActivityLifecycleCallbacks(new WebEngageActivityLifeCycleCallbacks(this, webEngageConfig));
}
```
```kotlin
import com.webengage.WebengageBridge;

override fun onCreate() {
  super.onCreate()
  WebengageBridge.getInstance();        // Add This
  // ... Webengage Initialization
  val webEngageConfig = WebEngageConfig.Builder()
      .setWebEngageKey(YOUR_WEBENGAGE_LICENSE_CODE)
      .setDebugMode(true) // only in development mode
      .build()
  registerActivityLifecycleCallbacks(
      WebEngageActivityLifeCycleCallbacks(
      this,
      webEngageConfig
      )
  )
}
```

### Attribution Tracking (Only Android)

Add the following [Google Install referrer](https://developer.android.com/google/play/installreferrer/library) library in your `app/build.gradle` file (ensure that the SDK version being used is >= 3.16.0):

```groovy
dependencies {
  implementation 'com.android.installreferrer:installreferrer:2.2'
}
```

> 🚧 Please Note
>
> `App Installed` event and `First Acquisition Details` data in user profile will not be tracked on your Android app unless you follow the above step.

## 3. Install iOS SDK

When constructing your iOS application, proceed with the [iOS Integration](https://docs.webengage.com/docs/ios-getting-started#2-initialize-the-sdk) instructions to install the iOS SDK. Skip the "Step 1 - Install the SDK" section and begin directly with "Step 2 - Initialise SDK" in the [iOS documentation](https://docs.webengage.com/docs/ios-getting-started#2-initialize-the-sdk).

<Image align="center" src="https://files.readme.io/65b5a1d-iOS_Integration.png" />

## 4 . Setting Up the SDK in React-Native

Grab a reference to the WebEngage React Native library in your JavaScript file.

<Callout icon="ℹ️" theme="info">
  We advise utilizing this code within your application's App.js or App.tsx file
</Callout>

```javascript JavaScript
import WebEngage from 'react-native-webengage';
var webengage = new WebEngage();
```
```typescript
import WebEngage from 'react-native-webengage';
import WebEngagePlugin from 'react-native-webengage/types';

var webengage: WebEngagePlugin = new WebEngage();
```

> ✅ Congratulations!
>
> You have successfully integrated WebEngage with your React Native apps and are sending user session data to WebEngage. Please note that it may take up to a few minutes for data to reflect in your dashboard

Please feel free to drop in a few lines at *<support@webengage.com>* in case you have any further queries. We're always just an email away!