Skip to main content
The observer is the structured view of the live stream’s lifecycle - the source to point metrics and alerting at. The logger carries human-readable text; the observer carries events you can count. Set either, both or neither.

The callbacks

Every method is optional - { onEvent: (n) => count(n) } is a complete observer.

Fallback reasons

Treat the value as open-ended; future versions may add reasons.

Recognised events

resync, config.created, config.updated, config.deleted, flag.created, flag.updated, flag.toggled, flag.deleted, secret.created, secret.updated, secret.deleted. Anything else is ignored and not surfaced.

The contract

Calls are synchronous and must return promptly - the SDK does not defer them. Copy what you need and dispatch the work yourself. An exception raised by an observer method is absorbed and reported: it cannot break the stream lifecycle, and it is written to the logger rather than swallowed. A test in the SDK walks the source and fails the build if any observer call bypasses that guard, so the guarantee is enforced rather than intended.

What it is not

The observer reports the transport. It is not a change feed: use the framework’s reactive reads for values. And a stream that has fallen back to polling is not an outage - reads keep working, only the propagation latency changes.