React Native SDK overview
@orga-ai/react-native delivers the same provider + hook ergonomics as the web SDK, but swaps in native media layers so Expo and bare React Native apps can host full duplex AI sessions. Think of it as the mobile façade around @orga-ai/core: it understands native permissions, manages react-native-webrtc, and coordinates audio routing via react-native-incall-manager.
What it is
- Adapter – Wraps the shared core runtime in React Native context, just like the web adapter does for the DOM.
- Native bridge – Talks to
react-native-webrtcfor camera/mic access andreact-native-incall-managerfor speaker/Bluetooth routing. - Parity layer – Exposes the same
useOrgaAI()API as the web SDK so business logic can be shared.
Why teams adopt it
- Expo-first workflows – Works in SDK 50+ with API Routes or custom dev builds, so you can ship on iOS and Android without forking codebases.
- Hardware-level control – Hooks deliver the same state as web but back it with real device streams; audio stays in sync across Bluetooth, speaker, or receiver.
- Consistent auth story – Uses the identical ephemeral token pipeline as web, keeping compliance reviews simple.
Conceptual flow
- App boots and calls
OrgaAI.init()once (usually in_layout.tsx) to registerfetchSessionConfig. <OrgaAIProvider>mounts, instantiates the core client, and subscribes to AppState events so sessions pause/resume cleanly.- When
startSession()runs, the SDK requests credentials from your backend, gathers ICE candidates withreact-native-webrtc, and sends the SDP offer via@orga-ai/core. - After Orga responds with the SDP answer +
conversation_id, hooks propagate state to UI components (<OrgaAICameraView>,<OrgaAIControls>, or your own). - Teardown stops tracks, releases audio focus through
incall-manager, and frees the peer connection.
Platform requirements
| Requirement | Details |
|---|---|
| React Native | 0.72+ (hooks rely on the new architecture). |
| Expo | SDK 50+ with custom development builds; Expo Go cannot load native modules. |
| Native deps | react-native-webrtc, react-native-incall-manager installed and rebuilt. |
| Hardware | Physical devices for QA—simulators rarely expose working cameras/mics. |
| Backend | Same credential proxy as web (commonly @orga-ai/node running in API Routes or a standalone service). |
Permissions & packaging highlights
- Declare camera/mic keys in
app.json/Info.plist and Android manifest. Without them,getUserMediawill silently fail. - Expo users must run
expo prebuild+eas build --profile developmentto load native modules even in development. - The SDK does not embed your API key—every session still calls your backend to obtain
{ ephemeralToken, iceServers }.
Where to look next
- Explore the React Native architecture explanation to see every layer.
- Need concrete steps? Follow the React Native tutorial.
- Want reference tables and props? Jump to the React Native SDK reference.
- Troubleshooting device quirks? Keep the React Native issues how-to handy.
Last updated on