Global

Methods


deny(channel, client, secret)

Deny a client access to a channel
Parameters:
Name Type Description
channel string the channel in which to deny the client from
client string the client to deny
secret string the secret key associated with this channel

grant(channel, client, secret)

Grant a client access to a channel
Parameters:
Name Type Description
channel string the channel in which to grant the client access to
client string the client to grant access
secret string the secret key associated with this channel

history(channel, limit, opts)

Get message history from a channel.
Parameters:
Name Type Description
channel string the channel to pull history from
limit number the ammount of items to pull from history
opts object options such as privateKeys
Properties
Name Type Description
privateKey string private key used for getting history from private channels

info(channel, data, opts)

List channels, get client info.
Parameters:
Name Type Description
channel string the channel to look at
data object additional information for request
opts object additional options for subscriptions
Properties
Name Type Description
privateKey string private key used for getting info from private channels

publish(channel, data, privateKey)

Publishes a message to all subscribers
Parameters:
Name Type Description
channel string the channel to publish to
data object the object to publish
privateKey string optional private key for private channels

subscribe(channel, callback, opts)

Subscribe to a channel
Parameters:
Name Type Description
channel string the channel to subscribe to
callback function new messages are returned here via msg
Properties
Name Type Description
msg object a new payload published to this channel
opts object additional options for subscriptions
Properties
Name Type Description
privateKey string private key used for subscribing to private channels
noself string subscribe for everything but ignore your own payloads
accessToken string used as a key to modify private channels. Not to be confused with privateKey
private string make this channel private, clients can only connect if granted access

Type Definitions


stringify (data)

Tries to return a stringified object.
Parameters:
Name Type Description
data object the object to attempt to stringify