Skip to content

Latest commit

History

67 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Pushover

Send pushover.net notifications from Node.JS

Build StatusCoverity Scan Build Status

Usage

Install

npm install pushover-notifications

Pushover API values

Any API parameters, as found on https://pushover.net/api, can be passed in the object. For example, retry and expire can be added to the object being passed to .send! Here's an example with many different parameters.

varmsg={message: "This is a message",title: "Well - this is fantastic",sound: 'magic',device: 'test_device',priority: 2,url: "http://pushover.net",url_title: "Pushover Website"};

Examples

Sending a message

varpush=require('pushover-notifications');varp=newpush({user: process.env['PUSHOVER_USER'],token: process.env['PUSHOVER_TOKEN'],// onerror: function(error) {},// update_sounds: true // update the list of sounds every day - will// prevent app from exiting.});varmsg={// These values correspond to the parameters detailed on https://pushover.net/api// 'message' is required. All other values are optional.message: 'omg node test',// requiredtitle: "Well - this is fantastic",sound: 'magic',device: 'devicename',priority: 1};p.send(msg,function(err,result){if(err){throwerr;}console.log(result);});

Sending a message to multiple users

varusers=['token1','token2','token3'];varmsg={message: 'omg node test',title: "Well - this is fantastic",sound: 'magic'// optionalpriority: 1// optional,};for(vari=0,l=users.length;i<l;i++){msg.user=users[i];// token can be overwritten as well.p.send(msg,function(err,result){if(err){throwerr;}console.log(result);});}

About

Pushover notifications for node.js (JavaScript,NodeJS)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages