Integrate Javascript SDK

This document will cover Javascript SDK installation and initialization steps for your web application

Installation

Install SDK using npm / yarn

npm i @suprsend/web-sdk
yarn add @suprsend/web-sdk

Initialization

Use SDK's init method to initialize the SuprSend SDK.

Once you initialize the sdk you can use all methods available in it. Make sure to initialize it before calling other methods of it. If you are using create-react-app, initialize it on top of App class in App.js.

import suprsend from "@suprsend/web-sdk";

suprsend.init(WORKSPACE_KEY, WORKSPACE_SECRET)

Replace WORKSPACE KEY and WORKSPACE SECRET with your workspace values. You will get both the tokens from Suprsend dashboard (Settings page -> "API keys" section). For more details, check the documentation on 'Workspaces'.