Skip to content

[I] SdkSseEventMetadata

Metadata about a single server-sent event within an SSE (text/event-stream) stream.

Derived from the @typespec/events event definitions of the streamed union, plus the @typespec/sse @terminalEvent marker. Gives emitters the information they need to (de)serialize each event without re-deriving it from raw TypeSpec: the wire event: name, whether the event terminates the stream, and the payload type/content type.

PropertyTypeDescription
contentType?stringThe content type of the event (the envelope when isEventEnvelope is true).
eventType?stringThe SSE event: field name, taken from the named union variant. Undefined for unnamed variants, which are message events with no event: field.
isEventEnvelopebooleanWhether type describes an event envelope wrapping a separate @data payload. When false, type and payloadType (and their content types) are the same.
isTerminalEventbooleanWhether the presence of this event terminates the stream and the client should disconnect (from @terminalEvent).
payloadContentType?stringThe content type of the event payload. Matches contentType when isEventEnvelope is false.
payloadTypeSdkTypeThe type of the event payload. Matches type when isEventEnvelope is false.
typeSdkTypeThe event type. Represents the event envelope when isEventEnvelope is true.