Installation
AsyncAudioInterface contract. See Custom Audio Interface below.
Quick Start
Text Conversation
Voice Conversation
Custom Audio Interface
React Native does not have a built-in browser audio API, so you must provide your own audio interface that implements theAsyncAudioInterface contract:
Recommended Audio Libraries
- react-native-audio-api — Low-level audio API
- expo-av — For Expo projects
- react-native-live-audio-stream — Real-time audio streaming
Authentication
Since cookies aren’t available in React Native, usecustomHeaders to pass authentication tokens when using a proxy server:
Best Practices
Resource Cleanup
Always stop the agent when the component unmounts:Handle App Lifecycle
Stop or pause the agent when the app goes to the background to avoid holding audio resources:Connection Timeout
Always specify a timeout when waiting for connection:Troubleshooting
Microphone Permission Denied
Request microphone permissions before starting a voice conversation. For Expo projects:Connection Timeout
- Check internet connectivity
- Verify your API key is valid
- Ensure
org_id,workspace_id, andapp_idare correct - Make sure the app has a committed version
No Audio Output
- Check device volume and silent mode switch (iOS)
- Verify your
AsyncAudioInterface.output()implementation is correctly writing to the audio output - Ensure the sample rate in your audio playback matches
output_sample_rate