1.0.32 • Published 6 years ago

jscommunicator v1.0.32

Weekly downloads
13
License
ISC
Repository
github
Last release
6 years ago

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.
1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

10 years ago