Mobile SDK Overview
The@navai/voice-mobile package provides voice-first AI navigation capabilities for React Native and Expo applications. It enables seamless integration of OpenAI’s Realtime API with mobile apps through WebRTC-based voice interactions.
What @navai/voice-mobile Provides
Core Features
- React Native & Expo Support: Full compatibility with React Native 0.72+ and Expo development builds
- Voice Agent Hook: Ready-to-use
useMobileVoiceAgentReact hook for managing voice sessions - WebRTC Transport: Mobile-optimized WebRTC transport layer using
react-native-webrtc - Backend Integration: Built-in client for Navai backend routes and function execution
- Route Navigation: Voice-controlled navigation to app routes
- Function Execution: Execute frontend and backend functions through voice commands
- Permission Handling: Automatic microphone permission requests for Android and iOS
Architecture
The mobile SDK consists of several key components:Installation
Install the package
Install
@navai/voice-mobile and its peer dependencies:The package requires
react-native-webrtc version 124 or higher.Link native dependencies
Key Differences from Web
The mobile SDK has several important differences from the web version:Transport Layer
- Mobile: Uses
createReactNativeWebRtcTransportwithreact-native-webrtc - Web: Uses browser’s native WebRTC APIs
Permission Handling
- Mobile: Explicit permission requests required (handled automatically by the hook)
- Web: Permissions requested during
getUserMediacall
useMobileVoiceAgent hook automatically handles Android permission requests:
Session Management
- Mobile: Uses
NavaiMobileVoiceSessionwith mobile-specific configuration - Web: Direct browser API integration
Environment Configuration
Mobile apps use runtime configuration instead of environment variables:Quick Start Example
Here’s a minimal example to get started:Next Steps
React Native Setup
Complete guide to using the mobile SDK in React Native apps
Expo Setup
Configure Expo projects with development builds
WebRTC Transport
Deep dive into the WebRTC transport layer
Backend Integration
Learn about backend routes and functions
