Set Up Your MediaSFU SDK
Choose your platform below, pin the named package version, and complete its backend and permission setup before opening a room. You do not need to learn another SDK first.
First choose where MediaSFU runs
Every client needs one deliberate deployment mode:
| Mode | Choose it when | Keep on your backend |
|---|---|---|
| MediaSFU Cloud | You want managed room and media infrastructure. | Cloud account credentials, user authorization, room policy, and rate limits. |
| Self-hosted MediaSFU Open | You operate the signaling and media infrastructure. | Server authorization, allowed endpoints, room policy, and deployment secrets. |
Your signed-in app sends ordinary room intent to its own HTTPS backend. The backend approves or rejects the action and returns only the room handoff needed by that person. Expire temporary authority, reject replay, and obtain a new handoff after sign-out, room exit, or an expired session.
signed-in app -> your /rooms/create or /rooms/join endpoint
your backend -> authorize user, role, room, capacity, and duration
your backend -> MediaSFU Cloud or your self-hosted deployment
your backend -> minimum approved room handoff
Never place a reusable MediaSFU account credential in browser code, a mobile binary, a game build, source control, logs, screenshots, or generated docs.
ReactJS 4.3.0
Install and pin the browser package:
npm install mediasfu-reactjs@4.3.0
Choose MediasfuGeneric when the host selects the experience at runtime. Use
MediasfuConference, MediasfuWebinar, MediasfuBroadcast, or
MediasfuChat when the product already has one fixed room shape.
Use an authenticated backend adapter for Cloud create/join. For self-hosted
rooms, supply only the approved server connection setting such as localLink.
Serve production browser rooms over HTTPS. Test microphone, camera, speaker
playback, autoplay recovery, and display capture in a two-user room.
Continue with React room operations.
Angular 2.3.1
Install and pin the Angular package:
npm install mediasfu-angular@2.3.1
Choose MediasfuGeneric, MediasfuConference, MediasfuWebinar,
MediasfuBroadcast, or MediasfuChat. Keep Cloud create authority on your
backend. If you self-host, pass the approved localLink and never a hidden
account secret from an Angular component.
Use HTTPS, request microphone/camera only when needed, and test display-capture approval, denial, cancellation, and stop. Confirm remote playback in a second browser; permission alone is not media readiness.
Continue with Angular room operations.
React Native 2.4.0
Install and pin the package:
npm install mediasfu-reactnative@2.4.0
Complete the package's native peer setup before building Android or iOS. Choose
MediasfuGeneric, MediasfuConference, MediasfuWebinar,
MediasfuBroadcast, or MediasfuChat for the intended experience.
Mobile apps have no same-origin backend. Configure one absolute HTTPS application-backend URL and let your authenticated HTTP client add the current app session. Declare Android camera/microphone permissions and the matching iOS privacy descriptions. Test permission denial, audio routes, backgrounding, camera switching, and screen capture on physical devices.
Continue with React Native room operations.
Expo 2.5.0
Install and pin the Expo package:
npm install mediasfu-reactnative-expo@2.5.0
Complete the Expo native configuration required by the package's media
dependencies. The available room shapes are
MediasfuGeneric, MediasfuConference, MediasfuWebinar,
MediasfuBroadcast, and MediasfuChat.
Send create/join intent to an absolute HTTPS application backend. Do not place account credentials in Expo public configuration, over-the-air updates, or local storage. Configure camera and microphone permission messages for every target, rebuild after native configuration changes, and validate on physical devices.
Continue with Expo room operations.
Vue 1.1.1
Install and pin the Vue package:
npm install mediasfu-vue@1.1.1
Choose MediasfuGeneric, ModernMediasfuGeneric, MediasfuConference,
MediasfuWebinar, MediasfuBroadcast, or MediasfuChat. Use a backend-backed
create/join adapter for Cloud, or the approved localLink for self-hosted
rooms.
Serve production rooms over HTTPS. Treat microphone, camera, and display capture as separate permissions, and confirm active producers and remote playback after approval.
Continue with Vue room operations.
Flutter 2.3.0
Pin the package from your approved delivery source:
dependencies:
mediasfu_sdk: 2.3.0
Choose MediasfuGeneric, MediasfuConference, MediasfuWebinar,
MediasfuBroadcast, or MediasfuChat. Use the package's create/join callbacks
to send only the room payload to your backend.
For self-hosted rooms, provide only your approved connection setting.
Declare camera and microphone use for Android and iOS, add platform screen capture support where you expose it, and use HTTPS for Flutter Web. Test every shipping platform separately because mobile, web, and desktop permission flows differ.
Continue with the Flutter room guide.
Android 1.0.5
Pin the Android room SDK in the app module:
dependencies {
implementation("com.mediasfu:mediasfu-sdk-android:1.0.5")
}
Start with MediasfuConference, or choose MediasfuGeneric,
MediasfuWebinar, MediasfuBroadcast, or MediasfuChat. Declare and request
internet, camera, microphone, and audio-setting permissions before enabling
media. Keep Cloud credentials on your backend; use localLink only for an
approved self-hosted server.
Continue with the Android SDK guide.
Kotlin Multiplatform 1.0.5
Pin the shared artifact in commonMain:
commonMain.dependencies {
implementation("com.mediasfu:mediasfu-sdk:1.0.5")
}
Choose MediasfuGeneric or the Conference, Webinar, Broadcast, and Chat
wrappers exposed for your target. Inject backend-backed create/join callbacks;
use localLink only for an approved self-hosted endpoint.
On Android, declare and request camera, microphone, internet, and audio-setting permissions. On iOS, add camera and microphone privacy descriptions. Test audio routing, background/foreground transitions, camera switching, and screen capture on every target you release.
Continue with Kotlin room operations.
Swift and Apple platforms
Add MediaSFUAppleSDK 0.1.3 through Swift Package Manager and embed the
MediaSFUSDK 1.0.3 XCFramework supplied with the Apple release. Import both
modules, then present the hosted room with MediaSFUIosHostBridge.
let bridge = MediaSFUIosHostBridge()
let config = bridge.makeLaunchConfig()
config.localLink = "https://media.example.com"
config.action = "join"
config.roomName = "weekly-product-room"
config.userName = "Ada"
let controller = bridge.makeHostViewController(config: config)
Add camera and microphone privacy descriptions. Add a ReplayKit broadcast extension if the product offers iOS screen sharing. Keep Cloud credentials off the device; the current Apple launch contract does not accept a credential-free Cloud grant.
Continue with the Swift SDK guide.
Unity 0.1.0-preview.2
Pin com.mediasfu.unity@0.1.0-preview.2 from your approved package source.
Complete the package's Unity media prerequisites before enabling local or
remote tracks; transport implementation packages are dependencies, not
separate MediaSFU SDK choices.
Unity exposes a room client, not Conference/Webinar/Broadcast/Chat UI wrappers. Your scenes own the product layout and room-shape experience. Use the backend-approved room handoff available to your application; the current client does not publish a credential-free create/join adapter.
Configure Unity player permissions and each native media backend for microphone, camera, playback, and screen capture. Validate exact desktop, mobile, WebGL, or XR player builds, not only Editor play mode.
Continue with Unity room operations.
Shared core 1.1.0
Install and pin the non-rendering core:
npm install mediasfu-shared@1.1.0 mediasoup-client socket.io-client
mediasfu-shared does not render Generic, Conference, Webinar, Broadcast, or
Chat rooms. Your application owns the entire room shape, state store, controls,
accessibility, and recovery UI. It may target Cloud through your backend or a
self-hosted deployment through approved connection configuration.
Your host runtime owns HTTPS or native permission declarations, device prompts, autoplay recovery, track rendering, and cleanup. Request only the media needed for the action and release every app-owned track and transport on exit.
Continue with shared-core room operations.
Release checklist
- The package manager resolves the exact package and version above.
- Cloud or self-hosted mode is named in the product configuration.
- Create and join go through authenticated application authority.
- Temporary room authority expires and cannot be replayed after exit.
- The chosen room shape matches the product's participant roles.
- Required platform permissions and privacy descriptions are present.
- Denial, cancellation, missing-device, and device-loss paths are usable.
- A two-user test confirms production and remote consumption.
- Exit clears app-owned media, listeners, identifiers, and authority.