Movatterモバイル変換


[0]ホーム

URL:


Dev guideRecipesAPI ReferenceChangelog
Dev guideAPI ReferenceRecipesChangelogUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog InFeature Experimentation
Dev guide
All
Pages
Start typing to search…

Install the React Native SDK

The steps necessary to install the Optimizely Feature Experimentation React Native SDK into your application.

The Feature Experimentation React SDK can be used in both ReactJS and React Native environments and is distributed throughnpm. The React SDK supports datafile caching and offline events persistence for React applications. Add it to your package with NPM:

npm install --save @optimizely/react-sdk

or with Yarn:

yarn add @optimizely/react-sdk

The full source code is available onGitHub.

Requirements

The Optimizely Feature Experimentation React Native SDK requires an ES5-compatible environment and Promise. To run in environments that do not support Promise, you can use promise-polyfill:

npm install promise-polyfill

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.

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 forcrypto.getRandomValues() support.
  • fast-text-encoding is required to support encoding for user bucketing.

Updated 17 days ago



[8]ページ先頭

©2009-2025 Movatter.jp