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-sdkindexProtocolWebSocketTransportAdapter
Class●Since v1.9

ProtocolWebSocketTransportAdapter

Copy
class ProtocolWebSocketTransportAdapter

Constructors

Properties

Methods

View source on GitHub
constructor
constructor
property
threadId: string
method
close
method
events
method
open
method
send
method
setOnReconnected
method
setThreadId

Transport adapter that speaks the thread-centric protocol over a bidirectional WebSocket. Bound to a threadId at construction or later via setThreadId — the socket connects to ws://.../threads/:thread_id/stream/events.

On unexpected disconnect the adapter reconnects with exponential backoff (see ProtocolWebSocketTransportOptions.maxReconnectAttempts). The server replays buffered events on the new socket; the SDK deduplicates by event_id. ProtocolWebSocketTransportOptions.onReconnected runs after each successful reconnect so ThreadStream can re-issue subscription.subscribe commands.