1.0.5 • Published 6 years ago
pushfry v1.0.5
Installation
$ npm i pushfry
Initialization
Client
const Pushfry = require('pushfry')
const pushfry = new Pushfry('YOUR_API_KEY')
Because of the security reason, please don't add your SECRET_KEY
when initializing pushfry in client. You just have to initialize with API_KEY
. And make sure you set the initializing origin
properly from Pushfry developer console.
Server
const Pushfry = require('pushfry')
const pushfry = new Pushfry('YOUR_API_KEY', 'YOUR_SECRET_KEY')
Usage
Join
const room = pushfry.join('room_name')
Emit
room.emit('channel_name', 'Hello world')
Listen
room.on('channel_name', data => {
// Handle data
})