LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Overview
  • Getting started
  • useStream
  • Selectors
  • Interrupts & headless tools
  • Subagents & subgraphs
  • Fork & edit from a checkpoint
  • Submission queue
  • Multimodal media
  • Transports
  • Suspense
  • StreamProvider & context
  • Type safety
  • Migrating to v1
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
OverviewGetting starteduseStreamSelectorsInterrupts & headless toolsSubagents & subgraphsFork & edit from a checkpointSubmission queueMultimodal mediaTransportsSuspenseStreamProvider & contextType safetyMigrating to v1
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/reactAgentServerAdapteropenEventStream
Methodā—Since v1.0

openEventStream

Copy
openEventStream(params: SubscribeParams): EventStreamHandle
View source on GitHub

Parameters

NameTypeDescription
params*SubscribeParams

Opens an independent filtered SSE event stream. Each call creates a new server connection with the given filter. Returns undefined when the transport does not support per-subscription streams (e.g. WebSocket), in which case the caller should fall back to command-based subscriptions over events.

Replay contract. Implementations MUST buffer events emitted for the thread/run and replay them through every newly-opened stream whose filter matches. The SDK's shared-stream rotation relies on this: when a subscription's filter widens the union, the SDK opens a fresh stream and expects to receive the run's full history from seq=0 (deduplication is handled client-side via event_id). The SDK also defers the open until after run.start has committed the thread server-side to avoid a 404: Thread not found, which means events emitted during that window MUST be delivered to the late opener. The protocol v2 server implements this via a bounded per-run replay buffer; custom adapters should mirror that.