Node SDK
Logspot SDK for browser applications built with React, Next.js, Angular, etc.
Installation
Section titled “Installation”npm install @logspot/node
or
yarn add @logspot/node
import Logspot from '@logspot/node';
Logspot.init({ secretKey: 'YOUR_SECRET_KEY' });Logspot.track({ event: 'UserSubscribed', userId: 'john@doe.com', metadata: { additionalData: '123' },});Parameters:
name- event name e.g. GroupCreateduserId(optional) - unique user id which will link the event to a specific user. It can be integer, UUID or even an email.metadata(optional) - you can attach a JSON object to your event.notify(optional) - triggers mobile notifcation.message(optional | max 255 chars) - messaged displayed in the app and in the notification.
Maximum size of the payload is 3kB.