1.0.5 • Published 7 years ago
pusha v1.0.5
Pusha Node Package
This Node package provides a simplified way to interact with the Pusha API.
Documentation
See the full documentation on Pusha's documentation.
Installation
npm install --save pusha
Requirements
Usage
This library needs to be configured with your API Key
which can be found here.
const pusha = require('pusha')('YOUR_API_KEY');
Basic example
The user token is needed from every user you wanna send notifications to. They can find it here.
const pusha = require('pusha')('YOUR_API_KEY');
pusha.send({
recipients: ['USER_TOKEN_1', 'USER_TOKEN_2'],
message: 'hello from node'
}).then(response => {
console.log(response)
}).catch(error => {
console.error(error)
})