@pexip/infinity
High-level client SDK for connecting to a Pexip Infinity MCU. Manages
authentication, WebRTC call lifecycle, conference controls, breakout rooms,
participant actions, and real-time event handling through a single
InfinityClient interface.
Install
npm install @pexip/infinity
Quick start
import {
createInfinityClient,
createInfinityClientSignals,
createCallSignals,
ClientCallType,
} from '@pexip/infinity';
// 1. Create signals
const signals = createInfinityClientSignals();
const callSignals = createCallSignals();
// 2. Create the client
const client = createInfinityClient(signals, callSignals);
// 3. Subscribe to events
signals.onConnected.add(() => console.log('Connected'));
callSignals.onRemoteStream.add(stream => {
videoElement.srcObject = stream;
});
signals.onDisconnected.add(({error}) => console.log('Disconnected', error));
// 4. Join a conference
await client.call({
conferenceAlias: 'meet.alice',
displayName: 'Bob',
node: 'pexip.example.com',
bandwidth: 1280,
callType: ClientCallType.AudioSendRecv | ClientCallType.VideoSendRecv,
});
Signals
The SDK uses @pexip/signal for event delivery. Create signal sets with the
provided factories:
| Factory | Purpose |
|---|---|
createInfinityClientSignals() | Conference events: participants, status, messages, auth, breakouts |
createCallSignals() | Call-level events: remote streams, stats, quality, reconnection |
Participant signals (onParticipantJoined, onParticipantUpdated,
onParticipantLeft) are batched automatically for performance.
Key signals
// Conference
signals.onConnected; // EventSource connected
signals.onDisconnected; // Session ended (includes error code)
signals.onAuthenticatedWithConference; // Token + conference info
signals.onConferenceStatus; // Room status changes
signals.onParticipantJoined; // Batched participant arrivals
signals.onParticipantLeft; // Batched participant departures
signals.onMe; // Current user's participant record
// Call
callSignals.onRemoteStream; // Main video/audio stream
callSignals.onRemotePresentationStream; // Presentation stream
callSignals.onCallConnected; // WebRTC connected
callSignals.onRtcStats; // Inbound/outbound metrics
callSignals.onCallQuality; // Quality scores
API overview
Conference controls
await client.lock({lock: true});
await client.muteAllGuests({mute: true});
await client.setLayout({transforms: {layout: 'ac', guest_layout: 'ac'}});
await client.disconnectAll({});
await client.startConference({});
await client.dial({destination: 'sip:room@example.com'});
Participant actions
await client.mute({mute: true, participantUuid});
await client.kick({participantUuid});
await client.admit({participantUuid});
await client.spotlight({enable: true, participantUuid});
await client.raiseHand({raise: true});
await client.transfer({destination, pin, role, participantUuid});
await client.setRole({role: 'chair', participantUuid});
await client.liveCaptions({enable: true});
Breakout rooms
const {breakout_uuid} = await client.breakout({participants: [...]});
await client.joinBreakoutRoom({breakoutUuid: breakout_uuid});
await client.breakoutMoveParticipants({fromBreakoutUuid, toRoomUuid, participants});
await client.closeBreakoutRoom({breakoutUuid});
await client.closeBreakouts();
Media control
client.setStream(newStream);
client.setBandwidth(720);
client.present(screenStream);
client.stopPresenting();
await client.restartCall({bandwidth: 1280});
State
client.roomId; // Current room ('main' or breakout UUID)
client.rooms; // All room IDs
client.conferenceStatus; // Map<RoomID, ConferenceStatus>
client.breakoutRooms; // Map<RoomID, BreakoutRoom>
client.serviceType; // 'conference' | 'gateway' | ...
client.conferenceFeatureFlags; // { chatEnabled, isDirectMedia, ... }
client.latestStats; // Inbound/outbound media metrics
client.getMe(); // Current user's participant record
client.getParticipants(roomId); // Participant list for a room
Custom logging
import {setLogger} from '@pexip/infinity';
setLogger(myLogger);
ClientCallType
Bitmask enum controlling media direction:
ClientCallType.None; // Control-only (no media)
ClientCallType.AudioSendRecv; // Audio both directions
ClientCallType.VideoSendRecv; // Video both directions
ClientCallType.PresentationRecv; // Receive presentation only
Combine with bitwise OR:
ClientCallType.AudioSendRecv | ClientCallType.VideoSendRecv | ClientCallType.PresentationRecv
License
Apache-2.0
Enumerations
| Enumeration | Description |
|---|---|
| ClientCallType | Client Call Type for client to make call w.r.t. audio, video, presentation direction |
| CallType | - |
Interfaces
| Interface | Description |
|---|---|
| RequestClient | - |
| RefreshTokenResult | - |
| RequestClientOptions | - |
| BreakoutRoom | - |
| Client | - |
| MediaPriority | Priority and QoS Model for each media line |
| ReceiverJitterBufferTarget | The jitterBufferTarget property of the RTCRtpReceiver interface |
| DegradationPreference | - |
| AllowMediaChangeOfDirection | - |
| CallOptions | - |
| Call | - |
| PresoConnectionChangeEvent | - |
| ClientSignals | - |
| RoomParticipantEvent | - |
| ParticipantSignals | - |
| InfinitySignals | - |
| MainStatsSignals | - |
| Stats | - |
| Incoming | - |
| IncomingCancelled | - |
| RegistrationSignals | - |
| CallSignals | - |
| SplashScreen | - |
| EventSignals | - |
| IceCandidate | - |
| DisconnectEvent | - |
| MessageEvent | - |
| StageEvent | - |
| LayoutEvent | - |
| PresentationEvent | - |
| NormalizedPresentationEvent | - |
| Source | - |
| LiveCaptionSpeaker | A participant credited as a speaker for a live captions fragment. |
| LiveCaptionsEvent | - |
| CallDisconnectedEvent | - |
| Participant | - |
| Message | - |
| ApplicationMessage | - |
| Stage | - |
| ConferenceStatus | - |
| TransferDetails | - |
| BreakoutReferDetails | - |
| ConferenceFeatureFlags | - |
| PresoState | - |
| StatsCollectors | - |
| ClientProps | - |
Type Aliases
Variables
| Variable | Description |
|---|---|
| CLIENT_CALL_TYPE_MAP | - |
| MAIN_ROOM_ID | - |
Functions
| Function | Description |
|---|---|
| createCall | - |
| createInfinityClient | Creates the main Infinity client orchestrator. |
| setLogger | - |
| createRegistration | - |
| withAuthorizationToken | - |
| isSSOdMessage | - |
| isMediaPriority | - |
| isJitterBufferTarget | - |
| isRoomID | - |
| assertRoomID | - |
| isParticipantID | - |
| assertParticipantID | - |
| createInfinityClientSignals | Create and return all required and optional (if specified with more), signals for infinity client to work |
| createCallSignals | Create and return all required and optional (if specified with more), signals for call to work |
| createRegistrationSignals | Create and return all required signals for registration to work |
| isWaiting | - |
| isGateway | - |
| isControlOnly | - |
| isReceivingAudio | - |
| isReceivingVideo | - |
| isReceivingPresentation | - |
| isReceivingAnyMedia | - |
| isSendingAudio | - |
| isSendingVideo | - |
| isSendingPresentation | - |
| isSendingAnyMedia | - |
| isUnidirectionalAudio | - |
| isUnidirectionalVideo | - |