Relatude Help

The event stream

GET {Path}/stream sends server-sent events. It takes the same bearer token as a command. A browser's EventSource cannot send that header, so read the stream with fetch, as the SDK does.

Event Payload Sent
connected { connectionId } first; collab-join needs the id
ping every 10 seconds, so a long silence means the connection is dead
unauthorized when the token runs out; the stream then closes
nodes-changed { changes: [{ id, type, kind }] } after a command changed nodes; kind is inserted, updated or deleted
process the process's snapshot to its user, when it starts, as it goes (at most four times a second) and when its state changes
process-dismissed { id } to its user
collab-presence { nodeId, revision, version, participants: [{ id, userId, name, live }] } to a room's connections, when someone joins, goes live, stops or leaves
collab { nodeId, revision, from, messages } to the connections of a room's other live participants
  • nodes-changed names only the nodes the connection's user can read, drafts included, and every deletion. Changes made outside the API, by the site's own code or in the admin UI, are not sent.
  • version in collab-presence rises with every change, also across restarts. The answer to collab-join or collab-live carries the version of its own change. The answer and the event can arrive in either order, so keep the list with the higher version.