Skip to Content
🚀 Orga AI is in open beta.
ExplanationSDKsReact NatveIntroduction

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-webrtc for camera/mic access and react-native-incall-manager for 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

  1. App boots and calls OrgaAI.init() once (usually in _layout.tsx) to register fetchSessionConfig.
  2. <OrgaAIProvider> mounts, instantiates the core client, and subscribes to AppState events so sessions pause/resume cleanly.
  3. When startSession() runs, the SDK requests credentials from your backend, gathers ICE candidates with react-native-webrtc, and sends the SDP offer via @orga-ai/core.
  4. After Orga responds with the SDP answer + conversation_id, hooks propagate state to UI components (<OrgaAICameraView>, <OrgaAIControls>, or your own).
  5. Teardown stops tracks, releases audio focus through incall-manager, and frees the peer connection.

Platform requirements

RequirementDetails
React Native0.72+ (hooks rely on the new architecture).
ExpoSDK 50+ with custom development builds; Expo Go cannot load native modules.
Native depsreact-native-webrtc, react-native-incall-manager installed and rebuilt.
HardwarePhysical devices for QA—simulators rarely expose working cameras/mics.
BackendSame 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, getUserMedia will silently fail.
  • Expo users must run expo prebuild + eas build --profile development to 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

Last updated on