API Reference
Components
Ready-to-use React components for Pipecat applications
The Pipecat React SDK provides several components for handling audio, video, and visualization in your application.
RTVIClientProvider
The root component for providing Pipecat client context to your application.
Props
client
(RTVIClient, required): A singleton instance of RTVIClient
RTVIClientAudio
Creates a new <audio>
element that mounts the bot’s audio track.
Props
No props required
RTVIClientVideo
Creates a new <video>
element that renders either the bot or local participant’s video track.
Props
participant
(“local” | “bot”): Defines which participant’s video track is renderedfit
(“contain” | “cover”, optional): Defines whether the video should be fully contained or cover the box. Default: ‘contain’mirror
(boolean, optional): Forces the video to be mirrored, if setonResize(dimensions: object)
(function, optional): Triggered whenever the video’s rendered width or height changes
RTVIClientCamToggle
A headless component to read and set the local participant’s camera state.
Props
onCamEnabledChanged(enabled: boolean)
(function, optional): Triggered whenever the local participant’s camera state changesdisabled
(boolean, optional): If true, the component will not allow toggling the camera state. Default: falsechildren
(function, optional): A render prop that provides state and handlers to the children
RTVIClientMicToggle
A headless component to read and set the local participant’s microphone state.
Props
onMicEnabledChanged(enabled: boolean)
(function, optional): Triggered whenever the local participant’s microphone state changesdisabled
(boolean, optional): If true, the component will not allow toggling the microphone state. Default: falsechildren
(function, optional): A render prop that provides state and handlers to the children
VoiceVisualizer
Renders a visual representation of audio input levels on a <canvas>
element.
Props
participantType
(string, required): The participant type to visualize audio forbackgroundColor
(string, optional): The background color of the canvas. Default: ‘transparent’barColor
(string, optional): The color of the audio level bars. Default: ‘black’barCount
(number, optional): The number of bars to display. Default: 5barGap
(number, optional): The gap between bars in pixels. Default: 12barWidth
(number, optional): The width of each bar in pixels. Default: 30barMaxHeight
(number, optional): The maximum height at full volume of each bar in pixels. Default: 120