Provider, CallingScreen, CallingUI, and shared UI props.
Props
CallingProvider
import { CallingProvider } from '@alaznah/calling';
<CallingProvider config={config} autoConnect>
{children}
</CallingProvider>
| Prop | Type | Required | Default | Description |
|---|
config | CallingClientConfig | Yes | — | User id, token getter, optional signaling override |
autoConnect | boolean | No | true | Connect when mounted |
children | ReactNode | Yes | — | Your screens |
config (CallingClientConfig)
| Prop | Type | Required | Default | Description |
|---|
userId | string | Yes | — | Logged-in user id (must match token) |
getAuthToken | () => string | Promise<string> | Yes | — | Short-lived token from your backend |
signalingUrl | string | No | Hosted default | Override; omit for Hosted Signaling |
deviceId | string | No | auto | Unique device id |
ringTimeoutMs | number | No | 60000 | Auto-drop if unanswered |
facingMode | 'user' | 'environment' | No | 'user' | Default camera |
iceServers | IceServerConfig[] | No | from signaling | Static ICE override |
iceTransportPolicy | 'all' | 'relay' | No | 'all' | Force TURN with 'relay' |
enableCallKeep | boolean | No | — | Optional second CallKit path; prefer false on iOS |
entitlementProvider | EntitlementProvider | No | dev trial | Paid feature session |
logger | { debug?, info?, warn?, error? } | No | — | Optional log hooks |
CallingScreen
<CallingScreen
userId={currentUser.id}
defaultPeerId="friend-id"
pushToken={devicePushToken}
pushPlatform="android"
onLogout={signOut}
onError={(e) => Alert.alert('Call error', e.message)}
/>
| Prop | Type | Required | Description |
|---|
userId | string | Yes | Same as config.userId |
defaultPeerId | string | No | Prefills who to call |
pushToken | string | null | No | Registers for incoming wake |
pushPlatform | 'ios' | 'android' | No | Platform for push registration |
onLogout | () => void | No | Optional logout handler |
onError | (error: Error) => void | No | Error callback |
Additional visual props (theme, backgroundColor, backgroundImage, slots) may be available depending on version — see package typings and Customization.
CallingUI
State router for incoming + active screens (bring your own dialer).
| Prop | Type | Required | Description |
|---|
client | CallingClient | Yes | From useCallingClient() |
theme | Partial<CallingTheme> | No | Colors / spacing |
backgroundColor | string | No | Call screen background |
backgroundImage | ImageSourcePropType | No | Optional backdrop |
slots | CallingUISlots | No | Swap avatar / header / controls |
renderIncomingScreen | fn | No | Custom incoming UI |
renderActiveCallScreen | fn | No | Custom in-call UI |
onError | (error: Error) => void | No | Error callback |
Slots (typical)
| Slot | Purpose |
|---|
renderHeader | Peer name / title area |
renderStatus | Subtitle / call state line |
renderAvatar | Avatar replacement |
renderControls | Replace default control row |
Video view props
LocalVideoView / RemoteVideoView / VideoView:
| Prop | Description |
|---|
stream | MediaStreamLike from the call |
mirror | Mirror local preview |
objectFit | 'cover' | 'contain' |
style | RN view style |
zOrder | Android z-order hint |
See UI Components and Call UI.