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-sdkstreamChannelRegistrybind
Methodā—Since v1.9

bind

Copy
bind(thread: ThreadStream<Record<string, unknown>> | undefined)
View source on GitHub

Parameters

NameTypeDescription
thread*ThreadStream<Record<string, unknown>> | undefined

The thread stream to bind, or undefined to detach.

Rebind every live entry to a new ThreadStream (or detach when thread == null).

Each live entry has its current runtime disposed (best-effort) and its store reset to entry.initial so consumers see a clean slate during the swap. When thread != null, a fresh runtime is opened against the new thread.

Critically the StreamStore instance is preserved across the rebind: framework subscribers (e.g. React's useSyncExternalStore) keep observing the same store reference, so their subscriptions survive the swap.

No-op when called with the currently bound thread.