Realtime
Ephemeral fanout for subscribers connected right now. → Realtime concept
Realtime → Listen on a channel, then Publish an event with a JSON payload; the log shows time #id channel event payload. Stop closes the stream.
hcloud realtime listen prj_… orders # prints events until Ctrl-Chcloud realtime publish prj_… orders created '{"order": 42}'curl -N "$ORIGIN/v0/projects/$PRJ/realtime/sse?channel=orders&channel=system" \ -H "Authorization: Bearer $TOKEN" -H 'Accept: text/event-stream'curl -X POST $ORIGIN/v0/projects/$PRJ/realtime/publish -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' -d '{"channel":"orders","event":"created","payload":{"order":42}}'Reconnect with Last-Event-ID: <id> to receive the best-effort replay (last 64 events per channel).
const stop = cloud.realtime.subscribe(project.id, ["orders", "system"], (e) => console.log(e.id, e.channel, e.event, e.payload), { onEnd: (reason) => console.log("stream ended:", reason),});await cloud.realtime.publish(project.id, { channel: "orders", event: "created", payload: { order: 42 } });stop();Limits: 32 KiB payloads, 16 channels per connection, 32 connections per credential, streams end after 300 s without an event. Publishing to system is refused.