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 npm registry to the Artifact repository using the following command:
    npm config set registry https://monetate.jfrog.io/artifactory/api/npm/monetate-npm-local
  2. Install the desired SDK packages.
    npm install @personalization-js-sdk/react-native
    npm install @personalization-js-sdk/common

if you encounter a peer dependencies issue in your project, use --legacy-peer-deps after the installation command.

Getting Started

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

const sdkInstace = new Personalization(account, user);