New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pusher/push-notifications-server

Package Overview
Dependencies
Maintainers
7
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pusher/push-notifications-server

NodeJS Server SDK for Pusher Push Notifications

  • 0.10.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
increased by5.31%
Maintainers
7
Weekly downloads
 
Created
Source

Build Status

Pusher Push Notifications Node.js Server SDK

Full documentation for this SDK can be found here

Installation

The Pusher Notifications Node.js server SDK is available on npm here.

You can install this SDK by using npm:

$ npm install pusher-push-notifications-node --save

Or yarn if you prefer:

$ yarn add pusher-push-notifications-node

Usage

Configuring the SDK for Your Instance

Use your instance id and secret (you can get these from the dashboard) to create a PushNotifications instance:

const PushNotifications = require('pusher-push-notifications-node');

let pushNotifications = new PushNotifications({
  instanceId: 'YOUR_INSTANCE_ID_HERE',
  secretKey: 'YOUR_SECRET_KEY_HERE'
});

Publishing a Notification

Once you have created your PushNotifications instance you can publish a push notification to your registered & subscribed devices:

pushNotifications.publish(['hello'], {
  apns: {
    aps: {
      alert: 'Hello!'
    }
  },
  fcm: {
    notification: {
      title: 'Hello',
      body: 'Hello, world!'
    }
  }
}).then((publishResponse) => {
  console.log('Just published:', publishResponse.publishId);
}).catch((error) => {
  console.log('Error:', error);
});

FAQs

Package last updated on 26 Mar 2018

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