LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-sdkindexProtocolSseTransportOptions
Interfaceā—Since v1.9

ProtocolSseTransportOptions

Copy
interface ProtocolSseTransportOptions

Properties

property
apiUrl: string
property
asyncCaller: AsyncCaller

Retries and concurrency for SSE/command HTTP. When omitted, requests use raw fetch with no automatic retries (same as constructing ProtocolSseTransportAdapter without this option).

property
defaultHeaders: Record<string, ProtocolHeaderValue>

Headers applied to every request.

The configured API key, when present, is added as the x-api-key header after these defaults are initialized.

property
fetch: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>

Optional fetch override, forwarded to the SSE transport. Useful for auth proxies, Next.js route handlers, or tests with injected mocks. Ignored when webSocketFactory is also supplied.

property
fetchFactory: () => (input: URL | RequestInfo, init?: RequestInit) => Promise<Response> | Promise<(input: URL | RequestInfo, init?: RequestInit) => Promise<Response>>
property
idleReconnect: IdleReconnectMode

Idle-reconnect policy guarding against half-open sockets that hang indefinitely with no error or close (e.g. a platform revision rollover that hard-kills the serving pod). On idle the underlying read is aborted, which the reconnect loop treats like any other disconnect, re-subscribing with since from the last seen sequence.

  • "auto": arm only once the server's SSE keep-alive heartbeats (LangGraph Platform: : heartbeat every ~5s) are observed, sizing the window from their cadence. Independent of agent activity; stays dormant on heartbeat-less servers.
  • a number: a fixed idle window in milliseconds.
  • 0: disables it.
property
maxReconnectAttempts: number

Maximum reconnect attempts after an unexpected SSE disconnect. Defaults to 5. Set to 0 to disable automatic reconnection.

property
onReconnect: (options: __type) => void

Called before each SSE reconnect attempt (after backoff delay).

property
onRequest: ProtocolRequestHook

Hook for inspecting or mutating a request before it is sent.

Receives the resolved URL and prepared RequestInit; return the original init or a replacement object to continue the request.

property
paths: ProtocolTransportPaths

Override the default /threads/:threadId/... protocol paths.

property
reconnectDelayMs: (attempt: number) => number

Backoff before each SSE reconnect attempt. Defaults to webSocketReconnectDelayMs from ./websocket.js.

property
threadId: string

Thread ID this transport currently targets.

View source on GitHub