Install the Monetate SDKs

This documentation guides you through setting up and implementing the React Web, React Native, iOS, and Android versions of the Monetate SDK.

React Web

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 Web version of the Monetate SDK consists of these packages:

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

To install the SDK packages, first set the default Artifactory npm registry using the following command:

Command to Set the Default Artifactory npm Registry


Next, install the desired SDK packages with each of the following codes:

Command to Install the Web SDK Package

Command to Install the Common SDK Package


If you encounter a peer dependencies error during installation, add the line --legacy-peer-deps to the installation command.

Getting Started

Use the following code to initialize an object to communicate with the Engine API:

Code to Initialize an Object to Communicate with Engine API


React Native

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 version of the Monetate SDK consists of these packages:

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

To install the SDK packages, first set the default Artifactory npm registry using the following command:

Command to Set the Default Artifactory npm Registry


Next, install the desired SDK packages with each of the following codes:

Command to Install the React Native SDK Package

Command to Install the Common SDK Package


If you encounter a peer dependencies error during installation, add the line --legacy-peer-deps to the installation command.

Getting Started

Use the following code to initialize an object to communicate with the Engine API:

Code to Initialize an Object to Communicate with Engine API


iOS

Prerequisites

You must have CocoaPods installed to set up this SDK. Refer to Getting Started in the CocoaPods Guides for more information.

Installing the SDK

Complete the following steps to integrate the SDK within your app.

First, open the PodFile and add the following code:

Code to Begin Installing Monetate SDK


Next, go to the root path of your project in the terminal and run pod install.

After installation, the SDK appears in the Pods directory in your project sidebar.

Callout of the monetate-ios-sdk folder in the location of the SDK in the Pods directory


Getting Started

Use the following code to initialize an object to communicate with the Engine API:

Code to Initialize an Object to Communicate with Engine API


Android

Prerequisites

You must have Android Studio installed to set up this SDK. Refer to the Android Studio site for more information.

Integrating the SDK into a Project

Complete the following steps to integrate the SDK within your app.

First, download the SDK source, and then open your app project and switch to Project View.

Project View in Android Studio, with a callout of the Project selector


Next, copy and paste the SDK into the app > libs directory.

Callout of the libs directory in Android Studio


Open the build.gradle(:app) file and include the following code under the dependencies section:

Dependencies Code

Callout of the implementation fileTree(include: ['*.jar'], dir: 'libs') line of code in Android Studio


Finally, click Sync Now in the notification that appears prompting you to perform a project sync.

Getting Started

Use the following code to initialize an object to communicate with the Engine API:

Code to Initialize an Object to Communicate with Engine API