React SDK Implementation Guide

This documentation guides you through setting up and implementing the React 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 SDK consists of three packages:

  • React Native: For applications using the React Native framework
  • Web: For applications written in React JavaScript
  • Common: Methods and constants shared between the other two packages

To install the SDK packages, complete the following steps:

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

Getting Started

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

const sdkInstace = new KiboPersonalization(account, user, contextMap);

For a complete list of methods and objects you can use, refer to SDK API Reference.