Web
For browser-based web apps using React.
React Native
For iOS and Android apps using React Native.
Flutter
For cross-platform mobile apps using Flutter.
Configuration
The configuration and API reference on this page apply to the TypeScript SDK (Web and React Native). For Flutter/Dart equivalents, see the Flutter page.Required Fields
Optional Fields
Using a Proxy Server
We strongly recommend using a proxy server for production deployments to keep your API key secure and enforce access control. See the Proxy Setup guide for server configuration, client examples for each platform, and security best practices.Mute and Unmute
Control microphone input without disconnecting:Custom Events via Transcript
Backend tools can send custom events to the frontend through thetranscriptCallback. These messages appear as bot transcripts with special formats that your app can intercept and handle.
Backend Requirement: Tools must emitServerToolEvent.NotifyUIevents withmessage_to_usercontaining the message content. See your backend SDK documentation for implementation details.
Thinking State
The backend sendsthinking_started and thinking_completed messages when tools are processing:
MCP Widgets
MCP (Model Context Protocol) Apps enable interactive widgets in your conversation UI. The backend sends widget URLs with data, and your frontend renders them in iframes.Message Format
The backend sends messages in this format:Parsing Widget Messages
Initializing the Widget
Widgets expect initialization data viapostMessage when the iframe loads:
Rendering the Widget
Agent State Tracking
Monitor the agent’s state to update your UI:Transcripts and Chat History
UsetranscriptCallback for voice conversation transcripts:
textCallback for text chat agent responses:
Analytics and Telemetry
Track SDK events for monitoring and debugging. Here’s an example using New Relic:Connection Lifecycle
Supported Languages
BENGALI,GUJARATI,KANNADA,MALAYALAM,TAMILTELUGU,PUNJABI,ODIA,MARATHI,HINDI,ENGLISH
API Reference
ConversationAgent Constructor
ConversationAgent Methods
Error Handling
The SDK provides typed error classes for different failure scenarios:Error Types
All errors extend
SDKError which has:
message- Human-readable error descriptioncode- Programmatic error code (e.g.,"RATE_LIMITED","AUTHENTICATION_FAILED")statusCode- HTTP status code if applicable
Handling Connection Errors
Use thetelemetryCallback to monitor connection issues:
Troubleshooting
Connection timeout
Ensure yourapp_id has a committed version. If no version is specified, the SDK uses the latest committed version—if none exists, the connection fails.