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

singular-s2s

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

singular-s2s

Server side events for singular

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Singular-S2S

npm package to send events from server based on user interaction et. al.

Singular Docs

Installation

npm install singular-s2s

Usage example

import Singular from "singular-s2s";

const eventData: any = {
      n: "event_name",
      e: JSON.stringify(payload), //event data
      p: platform, // Android or iOS
      i: packageIdentifier, // your app package name like com.company.com
      ip: IP, // user iP
      utime: epochInSeconds(),
      umilisec: getEpoch(),
      custom_user_id: userEvent.user_uid,
    };
if (platform === Platform.ANDROID) {
    eventData.andi = headers["device-id"].toLowerCase();
}
if (platform === Platform.IOS) {
    eventData.idfv = headers["device-id"].toUpperCase();
}
const singular = new Singular(SINGULAR_CONFIG.API_KEY);
// code is executed with try catch block so check if error
const {error, response} = await singular.sendEvent(eventData); 

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Author

praveenkumarKajla
praveenkumarKajla

Contributors

Keywords

FAQs

Package last updated on 21 May 2021

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