Skip to Content
🚀 Orga AI is in open beta.

React Native SDK architecture

@orga-ai/react-native translates the shared Orga core runtime into a mobile-aware stack. It wraps Expo/bare apps with a provider, orchestrates native WebRTC modules, and still relies on your backend for credential minting.

Layer map

LayerWhat it owns
UICamera previews, control overlays, navigation decisions.
React Native SDKProvider lifecycle, hook state, native module coordination.
CoreConfig storage, logging, sending SDP offers to Orga Cloud.
BackendSecret storage (ORGA_API_KEY) and credential exchange.

Session timeline

Key behaviors:

  • react-native-webrtc handles peer connections, ICE gathering, and rendering through <RTCView> (wrapped by <OrgaAICameraView>).
  • react-native-incall-manager manages audio focus and routing (speaker, receiver, Bluetooth).
  • The provider listens for AppState changes to pause/resume gracefully when the app background/foreground transitions.

Interaction with the backend

Your backend (commonly a Node SDK route hosted in Expo API Routes, Next.js API Routes, or any HTTP service) remains the security boundary. It alone touches the permanent API key, calls Orga’s REST endpoints, and hands the mobile client short-lived credentials.

🔒 Security recap: mobile clients never see sk_orga_ai_*. They only receive ephemeralToken + iceServers, both of which expire quickly.

Native considerations

  • Permissions – iOS Info.plist and Android manifest entries must be in place before startSession() is called; otherwise the OS will deny camera/mic access.
  • Expo dev builds – Because the SDK depends on native modules, Expo Go is not sufficient. Ship a dev build even for local QA.
  • Audio routing – incall-manager defaults to the device speaker; your UI can call setSpeakerphoneOn or chooseAudioRoute for more control.
  • Lifecycle – Tie OrgaAIProvider to the top of your app (typically _layout.tsx) so navigation changes do not reinitialize the client mid-call.
Last updated on