LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
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
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
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 v2.0

bind

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.

Copy
bind(thread: ThreadStream<Record<string, unknown>> | undefined)

Parameters

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

The thread stream to bind, or undefined to detach.

View source on GitHub