xstreamly-client

0.2.0 • Public • Published

X-Stream.ly Client

This is a node.js client library for interacting with X-Stream.ly

To include

npm xstreamly-client

To use

The API for this library is exactly the same as for the browser based JS API

first off you need to require the library:

var XStreamly = require('xstreamly-client');

next you need to create your client:

var client = new XStreamly('app key','security token');

To subscribe to a channel:

var channel = client.subscribe('stream name',{includeMyMessages:true});

To listen for messages of a specific type:

channel.bind('message type',function(data){
  //do fun stuff
});

To listen for all messages on a channel:

channel.bind_all(function(eventName,data){
  //do fun stuff
});

To Send a message:

channel.trigger('message type',{name:'Brian'});

To Send a persisted message:

channel.trigger('message type',{name:'Brian'},true);

For more detailed instructions check out out documentation

To test

install nodeunit

npm install nodeunit -g

run with nodeunit

nodeunit ./test/

/xstreamly-client/

    Package Sidebar

    Install

    npm i xstreamly-client

    Weekly Downloads

    2

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • bwillard