Push Event To User

The Push Event to User stage is used to send events from Flows to online users through your front end site.

In order to use this stage you must add a Javascript file to your front end code that will handle the communication between your website and Flows.

Javascript

To get started using this stage you must include the FlowsJS library on your front end.  See FlowsJS library and Listening to Events from Flows for more details on the front end functions of this stage.

Using the stage in Flows
 

 

Once you have the client side script up and running you can easily start sending messages from Flows by adding the "Push Event to User" stage.

Channel: This is the channel name that you want to send messages to. When listening to messages from Flows, on the front end, you will also set a channel name and these two must match in order for messages to be routed to the correct place.

You can choose to set a channel name using a unique identified such as session ID or user ID for sending messages to single users or you can choose a more generic name such as "broadcast" if you want many users to receive a single message.

NB: It's important the keep in mind then channel communication is not guaranteed to be secure. If a malicious user can guess a channel name then they can easily listen to messages coming in on that channel. Therefore it's important to choose a difficult to guess channel name when required and do not send sensitive data through this method.

Once a channel has been set on the stage, you can seta set of Key/Value pairs.  The resulting message sent will be a JSON message containing each key/value pair