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-sdkindexProtocolWebSocketTransportOptions
Interfaceā—Since v1.9

ProtocolWebSocketTransportOptions

Copy
interface ProtocolWebSocketTransportOptions

Properties

View source on GitHub
property
apiUrl: string
property
defaultHeaders: Record<string, ProtocolHeaderValue>
property
maxReconnectAttempts: number
property
onReconnect: (options: __type) => void
property
onReconnected: () => void | Promise<void>
property
onRequest: ProtocolRequestHook
property
paths: Pick<ProtocolTransportPaths, "stream">
property
reconnectDelayMs: (attempt: number) => number
property
threadId: string
property
webSocketFactory: (url: string) => WebSocket

Headers applied to every request.

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

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

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

Invoked after the socket has been re-established. Use to restore server-side subscription state (see ThreadStream).

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.

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

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

Thread ID this transport currently targets.

Optional WebSocket factory. Supplying it flips the adapter into WebSocket mode — SSE is bypassed entirely.