NexusStreamObserver via NexusConfig.streamObserver to receive structured callbacks for every SSE lifecycle transition. The observer is the canonical way to wire SDK state into ops dashboards, custom telemetry, or load-test tooling - far more reliable than scraping NexusLogger output by substring match.
The observer is opt-in. When streamObserver is undefined the SDK uses NOOP_STREAM_OBSERVER at zero overhead.
The interface
{ onEvent: (n) => count(n) } and ignore the rest.
Hook semantics
onFallback reasons
A
429 response with {"error":"quarantined"} body does NOT fire onFallback. It fires onQuarantined instead (v0.4.0). The stream failure counter is not incremented for quarantine reconnects.Threading contract
Counter pattern
Active-connection state pattern
Vue’s reactive primitives make this clean - wire the observer to aref defined outside any component setup function:
useNexusStreamStatus() composable - it returns the same connected boolean derived from the streamConnected getter.