---
title: Install the React Native SDK
slug: feature-experimentation/docs/install-the-react-native-sdk
docTags: 
createdAt: 2026-08-05T20:40:03.000Z
---

The React Native SDK is distributed through [npm](https://www.npmjs.com/package/@optimizely/react-sdk). Add it to your package with NPM:

```text
npm install --save @optimizely/react-sdk
```

or with Yarn:

```text
yarn add @optimizely/react-sdk
```

The full source code is at [https://github.com/optimizely/react-sdk](https://github.com/optimizely/react-sdk).

## Requirements

| Requirement   | Version   |
| ------------- | --------- |
| React         | >= 16.8.0 |
| Node.js       | >= 18.0.0 |
| Module format | ESM only  |

The React Native SDK v4 is distributed as ESM only. If your project uses CommonJS (`require()`), you need to switch to ESM imports or configure your bundler to handle ESM dependencies.

### Peer dependencies

To use features such as datafile caching and offline events persistence, you must install the following peer dependencies in your React Native application.

```shell
npm install --save @react-native-async-storage/async-storage @react-native-community/netinfo react-native-get-random-values fast-text-encoding
```

- `@react-native-async-storage/async-storage` is required to:
  - Enable datafile caching by storing the datafile on the user's device.
  - Enable event offline persistence by temporarily storing events on the user's device when offline.
- `@react-native-community/netinfo` is required to detect when internet connectivity is restored so that events triggered during the offline mode can be retried.
- `react-native-get-random-values` is required for `crypto.getRandomValues()` support.
- `fast-text-encoding` is required to support encoding for user bucketing.
