Socket
Socket
Sign inDemoInstall

trailpack-sinch

Package Overview
Dependencies
7
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    trailpack-sinch

trails sinch sms trailpack


Version published
Weekly downloads
6
increased by200%
Maintainers
1
Install size
277 kB
Created
Weekly downloads
 

Readme

Source

trailpack-sinch

version 0.1.0

run npm link NPM version Build status Dependency Status Code Climate

Sinch Trailpack for sending SMS

Install

With yo:

$ yo trails:trailpack trailpack-sinch

With npm:

$ npm install --save trailpack-sinch

Configure

// config/main.js
module.exports = {
  packs: [
    // ... other trailpacks
    require('trailpack-sinch')
  ]
}

Add configuration for sinch :

// config/sinch.js
module.exports = {
  /**
   * The "account Key" associated with your Sinch account.
   */
  Key: null,
  /**
   * The "account secret" associated with your Sinch account.
   */
  Secret: null,
  
}

Usage

Use the SinchService like this (from controllers/policies/services) :

//Send basic SMS
this.app.services.SinchService.sendMessage('phoneNumber', 'message').then(function (results) {
  this.app.log.debug('ok')
})
.catch(err => {
  this.app.log.error(err)
})
       
//Send messageid set status
this.app.services.SinchService.getStatus(jsonObj.messageId).then(function (results) {

  this.app.log.debug('ok ',results)
         
})
.catch(err => {
  this.app.log.error(err)
})

Sinch Account

The use of this requires setting up a sinch sms account (https://www.sinch.com/)

Credits

This trailpack is inspired by Jaumard's trailpack-twilio

We love contributions! Please check out our Contributor's Guide for more information on how our projects are organized and how to get started.

License

MIT

Keywords

FAQs

Last updated on 19 Jul 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc