scoutforpets / node-onesignal

Node.js wrapper for the One Signal API
MIT License
34 stars 11 forks source link
nodejs onesignal push-notifications

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');

// create a new clinet
const client = new OneSignalClient([YOUR APP ID], [YOUR REST API KEY]);

// send a notification
client.sendNotification('test notification', {
    included_segments: 'all'
});

API

OneSignalClient(appId, restApiKey)

sendNotification(message, options)

As you can see, this SDK does not implement all of the methods available through the OneSignal REST API. If there are other methods you require, please open an issue or feel free to create a PR (with tests!).

Contributing

Just open a PR and include tests. Any help is greatly appreciated!