A streaming client for flowdock flows
A node module for streaming flowdock flows.
npm install flowdock-stream
var FlowdockStream = require'flowdock-stream';var flowdockstream = FlowdockStreamcreateClient'organization' 'flow' 'apikey';flowdockstreamon'data'if dataevent === 'message' console.log'a message!' datacontent;;flowdockstreamon'error'throw err;;
A stream is created with the only exported function as follows:
FlowdockStream.createClient( organization, flow, apikey )
- all three arguments are mandatory
The stream itself is a readable node.js stream, but added are a couple of methods for convenience:
- Object that contains the ids and nicks of all the users in the flow at the time of joining, set once for your convenience
FlowdockStream.getUsers( callback )
- Function that takes a *callback* which returns two arguments *error* (Error), and *users* (Object)
FlowdockStream.send( message, [commentToId], [callback] )
- Function that can be used to send messages to the flow. Optionally you can pass an message-id as the second argument to send the message as a comment to a previous message. Also takes an optional callback which is passed to the underlying *request* module.