Core
ClientSSEConfig
Resolved SSE configuration with a required fetch handle.
@defjs/core · Type
Signature
interface ClientSSEConfig extends ClientSSEOptions { handle: FetchHandle; }
The type of ClientConfig.sse. It is ClientSSEOptions with handle always present; the default wrapper resolves the current global fetch on each attempt, rather than capturing it at import time.
Members
Prop
Type
handle FetchHandleFetch implementation used to open the event stream.
onInvalidEvent? ((context: { reason: "missing-struct" | "validation-failed"; message: { id: string; event: string; data: string; }; cause?: unknown; signal: AbortSignal; }) => unknown) | undefinedCalled when an event has no matching struct or fails validation.
reconnect? { attempts?: number; delayMs?: number; factor?: number; jitter?: number; maxDelayMs?: number; shouldReconnect?: (context: { attempt: number; cause?: unknown; lastEventId: string; method: string; open?: { response: { status: number; statusText: string; url: string; }; url: string; }; }) => boolean | Promise<boolean>; } | undefinedAutomatic reconnect policy after stream failures.