Skip to Content
LYNKORIADocs
SDK reference

React Native SDK reference

Exports of @lynkoria/react-native 0.1.0, generated from its type declarations.

Package @lynkoria/react-native, version 0.1.0. React Native 0.82+ (New Architecture only) with React 19; Expo through a development build, not Expo Go.

Generated from the package's bundled type declarations; every signature below is what your editor sees. For how to use it, read the guide.

Functions

joinCall

Requests permissions, fetches join credentials from your backend and connects natively.

function joinCall(opts: JoinCallOptions): Promise<NativeCall>;

parsePush

Parses a Lynkoria push from FCM data or the APNs lynkoria dictionary (same keys as the Kotlin and Swift SDKs). Returns null for pushes that are not from Lynkoria.

function parsePush(data: Record<string, string | undefined>): LynkoriaPush | null;

Classes

NativeCall

The active native call. Only one call is active per app; join again after leave().

class NativeCall {
  private current;
  private ended;
  private readonly subscriptions;
  private readonly stateListeners;
  private readonly participantListeners;
  /** @internal use {@link joinCall} */
  constructor();
  get state(): CallState;
  onStateChange(listener: (state: CallState) => void): Unsubscribe;
  onParticipantsChange(listener: () => void): Unsubscribe;
  participants(): Promise<readonly NativeParticipant[]>;
  setMicrophoneEnabled(enabled: boolean): Promise<void>;
  setCameraEnabled(enabled: boolean): Promise<void>;
  startScreenShare(): Promise<void>;
  stopScreenShare(): Promise<void>;
  audioDevices(): Promise<readonly string[]>;
  selectAudioDevice(name: string): Promise<void>;
  leave(): Promise<void>;
}

Constants

incomingCalls

System incoming-call UI (CallKit / Android CallStyle notification) and VoIP registration.

const incomingCalls: {
  /** Shows the system ringing UI for a Lynkoria `call_incoming` push. Returns true if handled. */
  handlePush(data: Record<string, string | undefined>): boolean;
  onAction(listener: (event: CallActionEvent) => void): Unsubscribe;
  /** iOS: PushKit token for `registerPushToken({ provider: 'apns_voip' })`. No-op on Android. */
  registerVoip(listener: (token: string) => void): Unsubscribe;
};

LynkoriaVideoView

const _default: HostComponent<NativeProps>;

Types

CallState

type CallState = 'connecting' | 'connected' | 'reconnecting' | 'disconnected';

JoinCallOptions

type JoinCallOptions = {
  /** Calls your product backend, which authorizes the user and returns Lynkoria join credentials. */
  getJoinToken: () => Promise<{
    url: string;
    token: string;
  }>;
  audio?: boolean;
  video?: boolean;
};

LynkoriaPush

type LynkoriaPush = {
  kind: 'call_incoming';
  callId: string;
  callType: string;
  fromUserId?: string;
  callerName?: string;
  tenantId?: string;
} | {
  kind: 'call_cancelled';
  callId: string;
} | {
  kind: 'message' | 'custom';
  data: Record<string, string>;
};

LynkoriaVideoViewProps

interface NativeProps extends ViewProps {
  /** Participant identity from `participants()`; the local participant uses its own identity. */
  participantIdentity: string;
  /** `camera` (default) or `screen`. */
  source?: CodegenTypes.WithDefault<'camera' | 'screen', 'camera'>;
  mirror?: CodegenTypes.WithDefault<boolean, false>;
  /** `fill` crops to cover the view; `fit` letterboxes. */
  scaleMode?: CodegenTypes.WithDefault<'fill' | 'fit', 'fill'>;
}

NativeParticipant

TurboModule backed by the native Lynkoria SDKs (lynkoria-android on LiveKit Android, Lynkoria on LiveKit Swift). Media never runs in JavaScript or a WebView. One active call per app.

type NativeParticipant = {
  identity: string;
  isLocal: boolean;
  hasAudio: boolean;
  hasVideo: boolean;
  hasScreenShare: boolean;
  isSpeaking: boolean;
};

Re-exported

Also exported from this package: ErrorCode (from @lynkoria/client), LynkoriaClient (from @lynkoria/client), LynkoriaClientOptions (from @lynkoria/client), LynkoriaError (from @lynkoria/client), createLynkoria (from @lynkoria/client).

On this page