The library makes it easy to publish events to the Appcelerator PubSub API service.
npm install appc-pubsub --save
You must first include the library and create an instance. At a minimum, you must pass in the key and secret values for constructing the client.
var PubSub = require('appc-pubsub'),
pubsub = new PubSub({
key: 'MY_KEY',
secret: 'MY_SECRET'
});Once you have created the client instance, you can publish events.
pubsub.publish('com.foo.bar');You can optional pass payload data for your event by passing an object as the second parameter:
pubsub.publish('com.foo.bar', {bar:1});The library is Confidential and Proprietary to Appcelerator, Inc. and licensed under the Appcelerator Software License Agreement. Copyright (c) 2015 by Appcelerator, Inc. All Rights Reserved.