The Pipecat React SDK provides hooks for accessing client functionality, managing media devices, and handling events.Documentation Index
Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
Use this file to discover all available pages before exploring further.
usePipecatClient
Provides access to thePipecatClient instance originally passed to PipecatClientProvider.
useRTVIClientEvent
Allows subscribing to RTVI client events. It is advised to wrap handlers withuseCallback.
usePipecatClientMediaDevices
Manage and list available media devices.usePipecatClientMediaTrack
Access audio and video tracks.usePipecatClientTransportState
Returns the current transport state.usePipecatClientCamControl
Controls the local participant’s camera state.usePipecatClientMicControl
Controls the local participant’s microphone state.usePipecatConversation
The primary hook for accessing the conversation message stream. Returns the current list of messages (ordered for display) and a function to inject messages programmatically. Each assistant message’s text parts are split intospoken and unspoken segments based on real-time speech progress, so you can style them differently (e.g. dim unspoken text).
Called once when a new message first enters the conversation. The message may
or may not be complete at this point — check
message.final.Called whenever an existing message’s content changes (e.g. streaming text
appended, function call status changed, message finalized). Check
message.final to detect finalization.Metadata for aggregation types to control rendering and speech progress
behavior. Used to determine which aggregations should be excluded from
position-based speech splitting.
The current list of conversation messages, ordered for display. Assistant messages have their text parts split into
{ spoken, unspoken } based on real-time speech progress.Programmatically inject a message into the conversation (e.g. a system prompt or user-typed input).
useConversationContext
Lower-level hook that provides direct access to the conversation context. Use this when you only needinjectMessage without subscribing to the message stream, or to check whether the connected bot supports BotOutput events.
Programmatically inject a message into the conversation.
Whether the connected bot supports BotOutput events (RTVI 1.1.0+).
null
means detection hasn’t completed yet.User interface
These hooks voice-enable a UI: stream the screen to a server-sideUIWorker, send UI events, handle the bot’s UI commands, and track background work. They must be used within a PipecatClientProvider. See the RTVI standard for wire payloads and Voice-enabling a client UI for the patterns.
useUISnapshot
Streams accessibility snapshots of the page to the bot. Call once near the root of your app.options?: UseUISnapshotOptions with enabled (default true), debounceMs (default 300), trackViewport (default true), and logSnapshots (default false).
useUIEventSender
Returns(event: string, payload?) => void to send app-defined UI events to the bot (routed to the worker’s @ui_event handlers).
useUICommandHandler
Registers a handler for a named UI command, active while the component is mounted.Default command handlers
useDefaultUICommandHandlers(options?) installs DOM handlers for all the standard commands at once (scroll_to, focus, highlight, select_text, set_input_value, click). Each resolves the target by snapshot ref, then target_id, and refuses unsafe targets. Install them individually with useDefaultScrollToHandler, useDefaultFocusHandler, useDefaultHighlightHandler, useDefaultSelectTextHandler, useDefaultSetInputValueHandler, and useDefaultClickHandler. For the non-DOM commands, useToastHandler(handler) and useNavigateHandler(handler) are typed convenience wrappers.
useUIJobGroups
Reads accumulated job groups (oldest first) and controls from the nearestUIJobGroupsProvider. Wrap your app in the provider to collect them:
UIJobGroupsAPI: groups: JobGroup[], cancelJobGroup(jobId, reason?), dismissJobGroup(jobId), and clearCompleted(). Each JobGroup has jobId, label, cancellable, status, and jobs (per-worker { workerName, status, updates, response }).