Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stack-finance/moengage-sdk

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stack-finance/moengage-sdk

An API to API NodeJS SDK for MoEngage

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

moengage-sdk

An API to API NodeJS SDK for MoEngage.


Requirements

You will need an account on MoEngage to make successful method calls from this package, obviously.

You will also need the API ID and API Key for your account, which can be obtained from Dashboard -> Settings -> APIs

Installation

npm i @stack-finance/moengage-sdk

Starter Code

import { MoEngage } from '@stack-finance/moengage-sdk';

const moengage = new MoEngage(
  '<API ID>',
  '<API Key>',
  '<Data Center - Only "01", "02" and "03" are valid values>');

const res = await MoengageSDK.triggerEvent({
  "type": "event",
  "customer_id": "john@example.com",
  "device_id": "96bd03b6-defc-4203-83d3-dc1c73080232",
  "actions": [{
      "action": "Added to Cart",
      "attributes": {
        "product": "Mobile",
        "color": "white",
        "Brand": "Apple"
      },
      "platform": "iOS",
      "app_version": "1.2.3",
      "current_time": new Date().getTime() / 1000,
      "user_timezone_offset": 19800
    },
    {
      "action": "Purchase",
      "attributes": {
        "product": "MacBook Air",
        "Brand": "Apple"
      },
      "platform": "web",
      "app_version": "1.2.3",
      "current_time": new Date().getTime() / 1000,
      "user_timezone_offset": 19800
    }
  ]
});
if (res.ok) {
  console.log(await res.json());
} else {
  // Errors are not handled in the package yet, for now you will have to handle this.
  // We will implement error handlign in the future versions.
  console.log(await res.text() || res.statusText());
}

Keywords

FAQs

Package last updated on 11 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc