hipchat-notification
Send room notifications
to the HipChat v2 API using a Bearer Token.
Installation
$ npm install --save hipchat-notification
Usage
TBD, from example.js
var room="devops";
var token="token_with_notification_privs";
var hipchat = require('hipchat-notifier').make(room, token);
hipchat.notice('this is a .notice()', function(err, response, body){
hipchat.info('this is a .info()', function(err, response, body){
hipchat.success('this is a .success()', function(err, response, body){
hipchat.warning('this is a .warning()', function(err, response, body){
hipchat.failure('this is a .failure()', function(err, response, body){
hipchat.setFrom('setter label');
hipchat.setNotify(true);
hipchat.setRoom(room);
hipchat.setToken(token);
hipchat.setHost('api.hipchat.com');
hipchat.notice('from setter label');
var body = {
from: 'random color label',
message: '<p><em>this message</em> is a random color',
color: 'random'
};
hipchat.send(body, function(err, res, body){
if(err) {
throw new Error(err);
}
console.log('finished');
});
});
});
});
});
});