SSE metadata access
When your API uses server-sent events, iterating the generated SDK’s streaming response yields parsed data objects. To also read the SSE protocol fields — event ID, event type, and retry interval — TypeScript and Go SDKs expose metadata-aware iteration, typically used to resume a stream by event ID.
Metadata-aware iteration
Each event exposes the parsed data alongside its protocol fields. Default iteration is unchanged, so opting in is fully backward compatible.
withMetadata() requires TypeScript SDK generator version 3.73.0+, and RecvEvent() requires Go SDK generator version 1.32.0+.
Stream resumption
The event ID is useful for resuming a stream via the standard Last-Event-ID header: store the last received ID as you iterate, then pass it back to the server on reconnection. This requires server-side support for the Last-Event-ID header.