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.

In pins 4 + flow
  • flow
    flow
  • channels required
    array

    Hidden when other fields are filled

  • channel required
    value

    A channel you would like the server to subscribe / listen on • Hidden when other fields are filled

  • events
    array

    Listen 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.

    Default ["*"]

  • skip jwt required
    condition

    Skips 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.

    Default false

Out pins 3 + flow
  • flow
    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.

Studio canvas example for the subscribe websocket on frontend block: typical wiring for subscribe websocket on frontend.

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