subscribe websocket on frontend
This block is part of the websocket group and was last modified in core v10.4.28.
subscribe websocket on frontend v10.4.28 Subscribes the websocket to a specific channel. All broadcasts will be pushed to that spark / the frontend.
- flow
- channels
arrayrequiredHidden when other fields are filled
- channel
valuerequiredA channel you would like the server to subscribe / listen on • Hidden when other fields are filled
- events
arrayListen on the provided events. If you would like to listen on all events within this channel, leave this array empty or provide
*as one of the values. - skip jwt
conditionrequiredSkips the broadcast of subscriptions to the frontend. If set to true, the frontend will not be able to resubscribe on the channels where the broadcast was skipped.
- flow
- success
condition - error
value - channels
array
Subscribes the current WebSocket connection to the given channels (channels array and channel pin merged, duplicates removed) so later broadcasts on them reach this client; the channels out pin lists the channels that actually subscribed. Scoped to the events list when wired, all events when empty. success=false with error MISSING_CHANNELS when no channel resolves, MISSING_WEBSOCKET when there is no connection, or PRODUCTION_RUN_ONLY in simulation. Unless skipjwt is true, the new subscription set is broadcast to the frontend.
A typical wiring for subscribe websocket on frontend: a function trigger starts the flow; with values feeds the channels pin; the flow out pin feeds debug.
Used in these guides
These documentation pages use or explain this block:
Version history
Introduced in v10.4.28.
Back to
websocket Return to the main group to view all sub-groups Back to websocket Return to the group to view all blocks within this group 