New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jscommunicator

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscommunicator

JS client for communicator

latest
Source
npmnpm
Version
1.0.32
Version published
Maintainers
2
Created
Source

jsCommunicator

Communicator client for javascript

Install

npm install jscommunicator --save

Usage

For web app

const express = require('express')
const jsComm = require('jscommunicator')
const app = express()

const config = {
                  communicator: {
                    communicatorQueueUri: 'beanstalk://localhost/dev-',
                    signingKey: 'xxxx'
                  }
                }

app.use(function (req, res, next) {
  client = new jsComm.CommunicatorClient(req, config, "accounts")
  const obj = client.getInstance('smsGenericPromotional')
  console.log(obj.getDomain())
  next()
})

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(3000, () => console.log('Example app listening on port 3000!'))

For workers


client = new jsComm.CommunicatorClient(null, config, "accounts")
const obj = client.getInstance('smsGenericPromotional')
obj.setDomain("domain value")

host eg. abc-access123.practodev.com

config eg. { communicator: { communicatorQueueUri: 'beanstalk://localhost/dev-', signingKey: 'xxxx' } }

appName eg. accounts

Get instance for the type of mail or sms

obj = client.getInstance('smsGenericPromotional')

Sending sms/email

obj.sendSms(params)
obj.sendMail(params)

Fetching sms/email info [GET request]

obj.getMessagesByReferenceId(2, '["FIT_RAY_SHARE_SMS"]', (err, response)=>{
  if(err){
    console.log(err);
  }
  else{
    console.log(response)}
  })

To contribute in jsCommunicator

Clone the repo

Finally build using npm run build

Update package in npm using npm publish

Notes

  • Make sure to run build before publish because it will publish the local lib folder.
  • Please don't push the lib version in git repository. Only the source code.

FAQs

Package last updated on 21 Jun 2018

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