Integrate Node SDK

This document will cover SDK installation and initialization steps

You can follow the steps mentioned in the documentation below or refer to our quick code recipe


🚧

Major Release v1.0.0

Starting from v1.0.0 Suprsend class will be a named import rather than default import. Please update the code like below, after migrating to v1.0.0 from lower versions.


Installation

suprsend-node-sdk is available as npm package. You can install using npm or yarn.

npm install @suprsend/node-sdk

# to upgrade to latest SDK version
npm install @suprsend/node-sdk@latest
yarn add @suprsend/node-sdk

# to upgrade to latest SDK version
yarn add @suprsend/node-sdk@latest

Initialization

For initializing SDK, you need WORKSPACE KEY and WORKSPACE SECRET.

const {Suprsend} = require("@suprsend/node-sdk");

// Initialize SDK
const supr_client = new Suprsend("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'.