Node Pushover Open Client
Pushover Open Client
Installation
npm install pushover-open-client
Usage
See pushover documentation here https://pushover.net/api/client
1. login
The first step is to login to to Pushover. This will give a secret
that will be used
for all subsequent requests.
var PushoverOpenClient = ;var poc =email: 'user@domain.com'password: 'something secure';poc;
will yield something like (data changed for privacy reasons)
2. register device
The next step is to use the secret
to register a new Pushover client. This
module will automatically store the secret retrieved during .login()
to be
used during subsequent requests. You may also pass the secret
in as part
of the constructor to skip the login step in the future.
poc;
will yield something like this:
id
in the above payload represents the new device_id
. Like the secret
during .login()
, this parameter will be stored for subsequent requests. You
may also pass it in to the constructor to skip the .register()
step in the
future.
3. fetch and delete queued messages
This will download all pending notifications, and also delete them from the server (signifying you have seen them)
poc;
will yield something like this
4. watch for new notifications
This will start an EventEmitter that will watch for new notifications to fetch and delete automatically for 5 seconds.
poc;poc;;
will yield something like this
License
MIT License