Skip to content

frnwtr/node-hooks-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-hooks

npm version Build Status

NPM

node wrapper for http://hooks.events

GET your copy of hooks.events on the site

INSTALL

npm install node-hooks-events -save

USAGE

var Hooks = require('node-hooks-events');

var hooks = new Hooks(appKey); //fill with given appkey from the app

// or if is an array of Api Keys
var hooks = new Hooks([
  appKey_1,
  appKey_2,
  ...
]);

send a message

hooks.send('title', 'message', callback(err,response));

that's it

Responses

If there is an error:

  err: <message>,
  {
    hooksTitle: '<title>',
    hooksMessage: '<message>',
    hookID: '<uuid of the hook request>',
    hooksApi: '<ref to appKey>',
    sent: false
  }

If request is ok:

  err:null,
  {
    hooksTitle: '<title>',
    hooksMessage: '<message>',
    hookID: '<uuid of the hook request>',
    hooksApi: '<ref to appKey>',
    sent: true
  }

BIN command:

hooks <apiKey>,<apiKey>,<apiKey>,... <title> <message>

Releases

No releases published

Packages

No packages published