Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

onesignal

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onesignal

Wrapper module for OneSignal push notification delivery

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

One Signal

npm npm

OneSignal Logo

A Wrapper for OneSignal Push Notification Delivery for Node.js. Provides the minimal functionality to send notifications for iOS and Android.

Installation

npm install onesignal --save

Usage

// Create a client object
var oneSignal = require('onesignal')('[apiKey]', '[appId]', true);

OneSignal(apiKey, appId, sandbox)

One Signal Client

ParamTypeDescription
apiKeyStringREST API Key
appIdStringOneSignal App ID
sandboxBooleanuse the sandbox certificate for iOS (default: false)

Methods

addDevice(identifier, osType)Promise

Register a new device and its identifier to OneSignal and get OneSignal ID

editDevice(oneSignalId, newIdentifier)Promise

Update the identifier of an existing device

createNotification(message, data, oneSignalIds)Promise

Create and send a notification

addDevice(identifier, osType) ⇒ Promise

Register a new device and its identifier to OneSignal and get OneSignal ID.

Returns: Promise - resolve with OneSignal ID

ParamTypeDescription
identifierStringthe device token
osTypeStringios, android

editDevice(oneSignalId, newIdentifier) ⇒ Promise

Update the identifier of an existing device.

ParamTypeDescription
oneSignalIdStringthe one signal device id
newIdentifierStringthe new device token

createNotification(message, data, oneSignalIds) ⇒ Promise

Create and send a notification.

ParamTypeDescription
messageStringthe notification message
dataObjectany custom data
oneSignalIdsArraya list of OneSignal devices ids

License

This project is under the MIT license.

Keywords

FAQs

Package last updated on 11 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc