node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



A node implementation of the SimplePush protocol.


You'll need node.js and npm installed first.

To install from github:

git clone
cd ./node-simplepush
npm install

If you want persistant storage, you'll need redis installed on your system also.


To start the SimplePush server, run:

node index.js

To run the examples, start the AppServer:

node examples/appserver.js

Then run the client:

node examples/client.js

Client API

var client = new SimplePUshClient(options)

Options may include:

  • pushServer: the WebSocket URL of the SimplePush server the client should connect to
  • uaid: a unique UserAgent ID. Defaults to a random uuid (version 4).



  • cb: fired once the client connects and completes the handshake



  • cb: callback called with three arguments:
    • An error if any, or null
    • A response object with channelID and pushEndpoint keys
    • A channel object that can receive push notifications. Attach a push event handler to the channel object to receive the notifications. E.g.
client.register(function(err, reply, channel) {
  console.log('Channel ID', reply.channelID);
  console.log('Endpoint: ', reply.pushEndpoint);
  channel.on('push', function(err, update) {
    console.log('Reveived update:', update.version);

client.unregister(channelID, cb)


  • channelID: The channel to unregister
  • cb: callback when unregistration completes