Guide for integrating the Sarvam Client SDK into browser-based React applications. For shared concepts like configuration, proxy setup, error handling, and API reference, see the Overview.

Installation

Use the /browser entry point for optimized bundle size:

Quick Start

Voice Conversation

Text Conversation


Audio Quality and Buffering

The BrowserAudioInterface uses adaptive buffering to handle network jitter. Adjust settings based on your network conditions:

Audio Level Visualization

Use audioLevelCallback to get real-time audio levels (e.g., to show when the agent is speaking):

BrowserAudioInterface


Full Example


Troubleshooting

”audioInterface is required for CALL interactions”

Provide a BrowserAudioInterface for voice conversations:

Audio doesn’t play in Firefox

Firefox requires user interaction before playing audio. Call start() from a click handler:

HTTPS required for microphone

Microphone access requires HTTPS in production. Use localhost for development.

Handling Microphone Permission Errors

Browser microphone access can fail for several reasons: