Pushes live updates to connected WebSocket clients via streams. Use when building real-time dashboards, live feeds, or collaborative features.
Comparable to: Socket.io, Pusher, Firebase Realtime
Use the concepts below when they fit the task. Not every stream setup needs all of them.
ws://host:{stream_port}/stream/{stream_name}/{group_id}createStream registers a custom adapter for non-default stream backendsstream_name, group_id, and item_id; data is the item payloadFunction
→ trigger('stream::set', { stream_name, group_id, item_id, data })
→ trigger('stream::send', { stream_name, group_id, data })
→ iii-stream
→ WebSocket push
→ Connected clients at /stream/{stream_name}/{group_id}
| Primitive | Purpose |
|---|---|
trigger({ function_id: 'stream::set', payload }) | Create or update a stream item |
trigger({ function_id: 'stream::get', payload }) | Read a stream item |
trigger({ function_id: 'stream::list', payload }) | List items in a stream group |
trigger({ function_id: 'stream::delete', payload }) | Remove a stream item |
trigger({ function_id: 'stream::send', payload }) | Push an event to connected clients |
createStream | Register a custom stream adapter |
See ../references/realtime-streams.js for the full working example — a stream that pushes live updates to WebSocket clients and manages stream items with CRUD operations.
Also available in Python: ../references/realtime-streams.py
Also available in Rust: ../references/realtime-streams.rs
Code using this pattern commonly includes, when relevant:
registerWorker(url, { workerName }) — worker initializationtrigger({ function_id: 'stream::set', payload: { stream_name, group_id, item_id, data } }) — write stream itemtrigger({ function_id: 'stream::send', payload: { stream_name, group_id, data } }) — push event to clientstrigger({ function_id: 'stream::get', payload: { stream_name, group_id, item_id } }) — read stream itemtrigger({ function_id: 'stream::list', payload: { stream_name, group_id } }) — list items in groupcreateStream(name, adapter) — custom adapter for specialized backendsFor browser-side WebSocket connections, use iii-browser-sdk instead of the Node SDK. See iii-browser-sdk skill for setup details. Stream authentication via literals is supported.
Use the adaptations below when they apply to the task.
chat-messages, dashboard-metrics, notifications)group_id to partition streams per user, room, or tenantiii-state-reactions to push a stream event whenever state changescreateStream when the default adapter does not fit (e.g. custom persistence or fan-out logic)iii-stream must be enabled in iii-config.yaml with a port and adapter (KvStore or Redis). See ../references/iii-config.yaml for the full annotated config reference.
iii-state-management.iii-state-reactions.iii-realtime-streams when the primary need is pushing live updates to connected clients.iii-realtime-streams in the iii engine.