Skip to main content



To install via NPM:

npm install

Getting Started

Init your SDK

Initialize your SDK with your Read and Write key which can be found on Developers Control Page of our project.

import { Client } from '';

let client = new Client();

.setReadKey('678sdsds7d...3esa2') // Your secret Read Key
.setWriteKey('9241cbs...443ds'); // Your secret Write Key

Make Your First Request

You can begin pushing your business data into your Business Goal as soon as your SDK object is configured. When building the data array, care must be given to ensure that each element is a non null object.

const sample_data = [
name: 'sample_name1',
age: 21,
name: 'sample_name2',
age: 27,
name: 'sample_name3',
age: 25,

client.computeData(sample_data, 'BUSINESS_GOAL_NAME')
.then((res) => console.log(res))
.catch((err) => console.log(err));

Add Users

Create user entity in the MOK platform. This entity will later be used to receive notifications through different providers.


Add User details

General purpose information like name, age, state/country they belong to, email and others can later be associated to this user by passing them as object to the below functions.


Set User's FCM token and Mobile Number

Communication details like phone number and third party credentials like FCM token can be set for a User.

To set a User's FCM token in particular:


To set a User's mobile number in particular:


Notify inactive Users

Gather information about user's activity and notify an inactive user through different providers, if the user hasn't logged into your site within a defined period. You can do so by sending the unique Notification Workflow ID as the first parameter and an object containing user data like communication details, i.e., phone number, name of the user and other details, as second parameter to the below function.

const user_data = {
mobile: '0123456789',
variables: ['firstname', 'lastname']

client.triggerNotificationWorkflow('NOTIFICATION_WORKFLOW_ID', user_data)
.then((res) => console.log(res))
.catch((err) => console.log(err));

You can find the Notification Workflow ID or UUID for a particular workflow in the Notification Workflow List by logging into your MOK app and navigating to the Notification Workflow in the sidebar.

Saved Notification Workflow

Notification Button

All the notifications can be fetched and displayed on your webpage by using this button.

import { NotificationButton } from '';

const App = () => {
return (

export default App;
apiKeystringYesThe Read API Key of the organization, which can be found on Developers Control Page of our project.
idstringYesThe Client ID
positionstring"right"optionalThe position of the Notification Box with respect to the Button