Defjs
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 FetchHandle

Fetch 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) | undefined

Called 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>; } | undefined

Automatic reconnect policy after stream failures.

Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao