0.0.2 • Published 7 years ago
node-onesignal-api v0.0.2
OneSignal SDK for Node.js
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.