Install the React Native SDK

This documentation guides you through setting up and implementing the React Native and React Web SDK.

Prerequisites

You must have Node and Yarn installed to set up this SDK. Refer to the installation instructions for Node and Yarn for more information.

Installing and Importing Packages

The React Native SDK consists of two packages:

  • React Native: For applications using the React Native framework
  • Common: Methods and constants shared between the React Native and Web packages

To install the SDK packages, complete the following steps:

  1. Set the default Artifactory npm registry using the following command:
    npm config set @personalization-js-sdk:registry https://monetate.jfrog.io/artifactory/api/npm/monetate-npm-local
  2. Install the desired SDK packages.
    npm install @personalization-js-sdk/react-native --legacy-peer-deps
    npm install @personalization-js-sdk/common --legacy-peer-deps

Getting Started

To initialize an object to communicate with the Engine API, use the following code:

const sdkInstace = new Personalization(account, user);