How to use the onesignal-node.Client function in onesignal-node

To help you get started, we’ve selected a few onesignal-node examples, based on popular ways it is used in public projects.

github realm / realm-sync-samples / 02-sending-email-with-sendgrid / index.js View on Github external
const Realm = require('realm');
const OneSignal = require('onesignal-node');

const oneSignalClient = new OneSignal.Client({
  userAuthKey: 'REPLACE_ME',
  // note that "app" must have "appAuthKey" and "appId" keys
  app: { appAuthKey: 'REPLACE_ME', appId: 'REPLACE_ME' }
});

// copy your instance URL here
const NOTIFIER_PATH = '/emails'
const SERVER_URL = '//REPLACE_ME';

const EmailSchema = {
  name: 'Email',
  properties: {
    toEmails: 'string[]',
    text: { type: 'string', default: '' }
  }
};
github realm / realm-sync-samples / 01-push-notifications-with-one-signal / index.js View on Github external
const Realm = require('realm');
const OneSignal = require('onesignal-node');


const oneSignalClient = new OneSignal.Client({
  userAuthKey: 'REPLACE_ME',
  // note that "app" must have "appAuthKey" and "appId" keys
  app: { appAuthKey: 'REPLACE_ME', appId: 'REPLACE_ME' }
});

// copy your instance URL here
const NOTIFIER_PATH = '/notifications'
const SERVER_URL = '//REPLACE_ME';

const NotificationSchema = {
  name: 'Notification',
  properties: {
    toUserIds: 'string[]',
    contentAvailable: { type: 'bool', default: false },
    text: { type: 'string', default: '' }
  }

onesignal-node

A Node.js Library for OneSignal push notification service

MIT
Latest version published 3 months ago

Package Health Score

72 / 100
Full package analysis

Popular onesignal-node functions