Organization Updates

View as Markdown

Use organization updates when your application needs realtime notifications across many spaces, runtimes, runs, and resources.

For runtime debugging, use run activity. Activity is the source of truth for what happened inside a runtime. Updates are a notification bus for broad resource changes.

Stream updates

1const controller = new AbortController();
2
3for await (const event of bctrl.updates.stream(controller.signal)) {
4 if (event.type === "runtime.stopped") {
5 console.log("Runtime stopped", event.data);
6 }
7}

The stream uses Server-Sent Events with automatic reconnection.

When to use updates

Use updates forUse run activity for
Dashboard refreshesExplaining what a runtime did
Runtime started/stopped notificationsBrowser navigation and action timeline
Invocation completion notificationsArtifact and recording events
Cross-space monitoringDebugging a single run

Stop listening

1controller.abort();