Components
Detailed documentation for OrgaAIProvider, OrgaAICameraView, and OrgaAIControls
OrgaAIProvider
Provides Orga context to your React Native app.
Import
import { OrgaAIProvider } from '@orga-ai/sdk-react-native';
Usage
<OrgaAIProvider>
{/* ...your app... */}
</OrgaAIProvider>
OrgaAICameraView
Displays the user’s camera feed with optional flip camera functionality and placeholder support.
Import
import { OrgaAICameraView } from '@orga-ai/sdk-react-native';
Usage
<OrgaAICameraView
streamURL={userVideoStream?.toURL()}
containerStyle={styles.cameraContainer}
style={{ width: "100%", height: "100%" }}
onFlipCamera={flipCamera}
placeholder={<Text>Camera not available</Text>}
/>
Props
|
Prop |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
|
|
Yes |
- |
The URL of the video stream to display |
|
|
|
No |
- |
Callback function when flip camera button is pressed |
|
|
|
No |
- |
Custom styles for the flip camera button |
|
|
|
No |
- |
Custom icon for the flip camera button |
|
|
|
No |
- |
Custom text for the flip camera button |
|
|
|
No |
- |
Custom styles for the container |
|
|
|
No |
|
Content to display when no stream is available |
|
|
|
No |
|
Current camera position (affects mirroring) |
|
|
|
No |
- |
Child components to render inside the camera view |
Features
-
Automatic Mirroring: Front camera is automatically mirrored for natural selfie experience
-
Placeholder Support: Shows custom content when no video stream is available
-
Flip Camera Button: Optional button to switch between front and back cameras
-
Customizable Styling: Full control over appearance through style props
-
RTCView Integration: Built on top of
react-native-webrtcfor optimal performance
OrgaAIControls
Provides a complete UI for controlling camera, microphone, and session management.
Import
import { OrgaAIControls } from '@orga-ai/sdk-react-native';
Usage
<OrgaAIControls
connectionState={connectionState}
isCameraOn={isCameraOn}
isMicOn={isMicOn}
onStartSession={startSession}
onEndSession={endSession}
onToggleCamera={toggleCamera}
onToggleMic={toggleMic}
onFlipCamera={flipCamera}
/>
Props
Required Props
|
Prop |
Type |
Description |
|---|---|---|
|
|
|
Current connection state ("disconnected", "connecting", "connected") |
|
|
|
Whether the camera is currently enabled |
|
|
|
Whether the microphone is currently enabled |
|
|
|
Function to start a new session |
|
|
|
Function to end the current session |
|
|
|
Function to toggle camera on/off |
|
|
|
Function to toggle microphone on/off |
|
|
|
Function to flip between front/back camera |
Styling Props
|
Prop |
Type |
Description |
|---|---|---|
|
|
|
Custom styles for the main container |
|
|
|
Custom styles for the controls overlay |
|
|
|
Custom styles for individual control buttons |
|
|
|
Custom styles for button labels |
|
|
|
Custom styles for the connect button |
|
|
|
Custom styles for the disconnect button |
Text Customization
|
Prop |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
"Start Conversation" |
Text for the start button |
|
|
|
"Connecting..." |
Text shown while connecting |
|
|
|
"Disconnect" |
Text for disconnect button |
|
|
|
"Camera On" |
Label for camera on state |
|
|
|
"Camera Off" |
Label for camera off state |
|
|
|
"Mic On" |
Label for microphone on state |
|
|
|
"Mic Off" |
Label for microphone off state |
|
|
|
"Flip" |
Label for flip camera button |
|
|
|
"End" |
Label for end session button |
|
|
|
"Tap to begin AI conversation" |
Subtitle for connect button |
Control Visibility
|
Prop |
Type |
Default |
Description |
|---|---|---|---|
|
showCameraControl |
|
|
Whether to show camera toggle button |
|
showMicControl |
|
|
Whether to show microphone toggle button |
|
showFlipCameraControl |
|
|
Whether to show flip camera button |
|
showEndSessionControl |
|
|
Whether to show end session button |
Loading Customization
|
Prop |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
|
Custom loading indicator |
|
|
|
"white" |
Color for the default loading indicator |