Skip to main content

mediasfu-shared

Essential next steps

This page targets mediasfu-shared@1.2.0. A restricted, revocable credential may be used for isolated local development and must never be committed. Before sharing or releasing the client, move reusable Cloud credentials behind the production credential boundary.

mediasfu-shared is MediaSFU's low-level TypeScript room core. It gives an app the room, socket, transport, permission, media, participant, screen-sharing, and exit primitives; it does not render a room, participant tile, or control bar for you.

Use it when your team owns the complete interface and runtime orchestration. For a prebuilt room, choose a platform SDK instead.

Copy/paste starter

Install the exact shared-core version and its peer dependencies with your approved package source:

npm install mediasfu-shared@1.2.0 mediasoup-client socket.io-client

Create a small operation binding for the controls your app will render:

import {
allMembers,
checkPermission,
clickAudio,
clickScreenShare,
clickVideo,
confirmExit,
processConsumerTransports,
} from 'mediasfu-shared';

export const roomCore = {
receiveMembers: allMembers,
checkPermission,
toggleMicrophone: clickAudio,
toggleCamera: clickVideo,
receiveRemoteMedia: processConsumerTransports,
toggleScreenShare: clickScreenShare,
leaveParticipant: confirmExit,
};

This object does not create a room or render controls. Continue with the shared-core room operations guide to connect it to app-owned UI, runtime parameters, recovery states, and cleanup.

Before you start

  • Resolve mediasfu-shared 1.2.0 from the package source approved for your project, with compatible mediasoup-client and socket.io-client peer dependencies locked by your package manager.
  • Provide an authenticated application backend for room authority. Never place reusable MediaSFU credentials in a browser, mobile bundle, desktop app, or source repository.
  • Plan your own interface for the room, participants, media controls, errors, and cleanup. The shared core supplies no rendered UI.

The shared-core room operations guide shows a safe application boundary and the exact primitives to bind for joining, member updates, permission decisions, media, screen sharing, and participant exit.

The current core does not offer a safe client-side room-creation contract or a separate semantic host-end action. Keep both workflows in your backend and product layer.