0.0.9 • Published 6 years ago

rapidsockets v0.0.9

Weekly downloads
26
License
-
Repository
github
Last release
6 years ago

RapidSockets JS SDK

Introduction

This is the official Software Development Kit for JavaScript to interact with the RapidSockets real-time messaging platform.

Browser specific dependency

To use the RapidSockets SDK in the browser, copy dist/rapidsockets.min.js and include in your site.

Node.js specific dependency

Install with npm install rapidsockets and include const RapidSockets = require('rapidsockets');.

Common Usage

// initialize and open a connection to the RapidSockets Gateway
var rs = new RapidSockets({
    key: 'your multi key'
});

// start listening for new messages on channel "mytest"
rs.subscribe({
    channel: 'mytest',
    callback: function(packet) {
        console.log(packet);
    }
});

// as a test, publish messages to channel "mytest" every two seconds
setInterval(function() {
    rs.publish({
        channel: 'mytest',
        message: 'test message'
    })
}, 2000);

Development specific notes

# build browser sdk
node_modules/.bin/gulp

# dev browser sdk and watch for changes
node_modules/.bin/gulp watch
0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.1

6 years ago