LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
  • 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
WebChannelsPregelPrebuiltRemoteStream
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/reactUseChannelEffectOptions
Interfaceā—Since v1.0

UseChannelEffectOptions

Options for useChannelEffect. Extends the projection options (bufferSize, replay) with the per-event callback, an optional error sink, a target scope, and an enabled gate.

Copy
interface UseChannelEffectOptions

Bases

ChannelEffectOptions

Properties

View source on GitHub
property
bufferSize: number
property
enabled: boolean
property
onError: (error: unknown) => void
property
onEvent: (event: Event) => void
property
replay: boolean
property
target: SelectorTarget

Maximum number of events retained in the projection snapshot. Defaults to 4096 so replay-backed discovery hooks can tolerate bursty token/media streams without dropping early lifecycle events.

Gate the subscription. When false, no subscription is opened and no events are delivered. Defaults to true. Flipping this lets you pause analytics (e.g. while the user is viewing a different thread) without unmounting.

Invoked when onEvent throws. When omitted, a throwing onEvent is swallowed so one bad delivery cannot wedge the shared store's notification loop or other consumers.

Invoked once for every event observed while attached.

Whether to open a real subscription and receive replayed history. Defaults to true. Set false for live-only root-bus inspection when replay is unnecessary.

Scope events to a subagent / subgraph / explicit namespace. Defaults to the root namespace.