node-onesignal-api

0.0.2 • Public • Published

OneSignal SDK for Node.js Build Status

This is an unofficial Node.js SDK for the OneSignal Push Notification Service, which wraps their REST API.

Basic Usage

// require the module
const OneSignalClient = require('node-onesignal-api');
 
// create a new clinet
const client = new OneSignalClient({
    appId: '****',
    restApiKey: '****'
});
 
// send a notification
client.createNotification({
  contents: {
    contents: 'Content!'
  },
  specific: {
    include_player_ids: ['****']
  },
  attachments: {
    data: {
      hello: "world"
    }
  }
}).then(success => {
    // ..
})
 

More about contents,attachments and specific.

Package Sidebar

Install

npm i node-onesignal-api

Weekly Downloads

3

Version

0.0.2

License

MIT

Last publish

Collaborators

  • cond