Quickstart
Use this page when the goal is to get a MediaSFU SDK integration running with the least amount of decision overhead.
Fastest path by SDK or platform
| SDK or platform | Start here | Best when |
|---|---|---|
| ReactJS | ReactJS SDK | You want the most direct web integration path. |
| Angular | Angular SDK | You want Angular-native DI and wrappers. |
| React Native | React Native SDK | You are shipping a bare RN app. |
| Expo | React Native Expo SDK | You are on the Expo-managed workflow. |
| Vue | Vue SDK | You want composition-friendly Vue integration. |
| Flutter | Flutter SDK | You want one Dart codebase across mobile, web, desktop, or embedded surfaces. |
| Android / Kotlin | Kotlin SDK | You want a native Android or Kotlin Multiplatform Compose-first room surface. |
| Apple / Swift | Swift SDK | You want a native Swift entry point for iOS, iPadOS, or macOS. |
| Unity | Unity SDK | You want a Unity-owned scene, UI, and media presentation layer. |
| Shared | mediasfu-shared | You are building your own wrapper or framework integration. |
Native platform quick picks
- Start with Kotlin SDK for native Android apps or Kotlin Multiplatform Compose surfaces.
- Start with Swift SDK for native Apple-platform apps that present MediaSFU from SwiftUI or UIKit/AppKit flows.
- Start with Unity SDK when the room experience belongs inside a Unity scene or interactive 3D product.
- Start with Flutter SDK when you want one codebase to cover Android, iOS, web, desktop, and other Flutter targets.
Copy/paste starters
Use these when you need a working starter on the page itself instead of jumping out to another SDK guide first.
Android / Kotlin
Add the artifact:
dependencies {
implementation("com.mediasfu:mediasfu-sdk-android:1.0.1")
}
Mount the default room surface:
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.mediasfu.sdk.model.Credentials
import com.mediasfu.sdk.ui.mediasfu.MediasfuGeneric
import com.mediasfu.sdk.ui.mediasfu.MediasfuGenericOptions
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MediasfuGeneric(
options = MediasfuGenericOptions(
credentials = Credentials("your_username", "your_api_key")
)
)
}
}
}
Apple / Swift
Add the Swift package:
https://github.com/MediaSFU/mediasfu-apple-sdk.git
Present the hosted room controller:
import MediaSFUAppleSDK
let bridge = MediaSFUIosHostBridge()
let config = bridge.makeLaunchConfig()
config.apiUserName = "your-api-username"
config.apiKey = "your-64-character-api-key"
config.localLink = ""
config.connectMediaSFU = true
config.userName = "alice"
config.roomName = "mediasfu-demo"
config.action = "create"
config.eventType = "conference"
config.durationMinutes = 60
config.capacity = 100
config.autoProceed = false
config.useModernUI = true
config.useModernTheme = true
let controller = bridge.makeHostViewController(config: config)
controller.modalPresentationStyle = .fullScreen
present(controller, animated: true)
Unity
Install com.mediasfu.mediasoup-client-unity first, then com.mediasfu.unity.
using MediaSFU.Unity;
var client = new MediaSfuClient(
new MediaSfuClientOptions
{
ConnectionMode = MediaSfuConnectionMode.Cloud,
Credentials = new MediaSfuCredentials
{
ApiUserName = "your-api-username",
ApiKey = "your-64-character-api-key"
}
}
);
var deviceResult = MediaSfuNativePluginWebRtcEngine.TryCreateWebRtcDevice(
new MediaSfuNativePluginWebRtcEngineOptions
{
EnableVerboseLogging = true
});
if (!deviceResult.Success)
{
UnityEngine.Debug.LogError(deviceResult.Detail);
return;
}
client.AttachWebRtcDevice(deviceResult.Value);
var join = await client.JoinRoomAsync(
new MediaSfuJoinRoomRequest
{
MeetingId = "s12345678",
UserName = "player-one",
IsLevel = "0"
}
);
if (!join.Success)
{
UnityEngine.Debug.LogError(join.Detail);
return;
}
var connect = await client.ConnectMediaAsync();
if (!connect.Success)
{
UnityEngine.Debug.LogError(connect.Detail);
}
Flutter
Install the package:
flutter pub add mediasfu_sdk
Mount the default room surface:
import 'package:flutter/material.dart';
import 'package:mediasfu_sdk/mediasfu_sdk.dart';
void main() => runApp(const MediaSFUExampleApp());
class MediaSFUExampleApp extends StatelessWidget {
const MediaSFUExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MediasfuGeneric(
options: MediasfuGenericOptions(
credentials: Credentials(
apiUserName: 'your_username',
apiKey: 'your_api_key',
),
),
),
);
}
}
For ReactJS, Angular, React Native, Expo, and Vue, use the matching SDK page when you need the framework-specific starter because those pages already include their package install and first-render path.
Native capability map
Use this table when the question is not just "how do I start?" but "how far can I take this SDK before I need a different path?"
| SDK | Fastest room path | App-owned setup or prejoin | App-owned room shell | Targeted UI customization path | Go deeper |
|---|---|---|---|---|---|
| Flutter | Prebuilt MediasfuGeneric room | Yes, with noUIPreJoinOptionsCreate or noUIPreJoinOptionsJoin | Yes, with returnUI: false and customComponent | Yes, with uiOverrides | Flutter SDK and MediaSFU sandbox links from that page |
| Kotlin | Prebuilt Compose room wrappers | Yes, by pairing returnUI = false with your own Compose entry flow | Yes, through onParametersUpdate and customComponent | Use Compose component replacement patterns from the Kotlin SDK guide | Kotlin SDK |
| Swift | Hosted room controller from Swift | Yes, with autoProceed = true and your own setup screen before presenting the controller | Use your own setup flow, then present the hosted controller for the room itself | Use your own app UI around the hosted controller rather than an override map | Swift SDK and the Apple SDK repository linked there |
| Unity | Scene-owned client integration | Yes. Your app or game owns room setup before JoinRoomAsync | Yes. Unity owns the scene, layout, and interaction layer around the client and media backend | Use your Unity scene and UI composition rather than an override map | Unity SDK and the Unity SDK API contract linked there |
Next step by native intent
- If you want a Flutter app to keep MediaSFU runtime logic but own the visible workspace, go next to Headless mode, Custom component replacement, and then Flutter SDK.
- If you want a Kotlin app to keep the Compose-native path but own the room shell, go next to Headless mode, Custom component replacement, and then Kotlin SDK.
- If you want a Swift app to own the setup screen but still present MediaSFU's hosted room controller, stay on the Swift SDK path and use its
autoProceed = trueflow. - If you want a Unity app or game to keep the whole experience scene-owned, stay on the Unity SDK path and treat the SDK client plus attached media backend as room infrastructure inside your own scene architecture.
Advanced native snippets
These are the higher-control paths already documented on the current native SDK pages.
Flutter headless workspace handoff
MediasfuGeneric(
options: MediasfuGenericOptions(
credentials: credentials,
returnUI: false,
updateSourceParameters: (parameters) {
setState(() => sourceParameters = parameters);
},
),
)
Use this when Flutter should own the visible workspace while MediaSFU still owns room runtime, state, and media helpers.
Kotlin app-owned Compose shell
var parameters by remember { mutableStateOf<MediasfuParameters?>(null) }
MediasfuGeneric(
options = options.copy(returnUI = false),
onParametersUpdate = { parameters = it }
)
Use this when your Compose app should render its own room shell around MediaSFU state and actions.
Swift app-owned setup before room presentation
let bridge = MediaSFUIosHostBridge()
let config = bridge.makeLaunchConfig()
config.action = "join"
config.roomName = "s1234567"
config.userName = "guest1"
config.autoProceed = true
let controller = bridge.makeHostViewController(config: config)
present(controller, animated: true)
Use this when your Apple app owns the setup screen and hands users into the hosted MediaSFU room only after your own app flow is complete.
Native usage examples beyond first render
These are the main public examples already available across the current native SDK pages.
- Flutter: prebuilt room, local UI/demo mode, headless runtime with
MediasfuParameters, direct create/join helpers,uiOverrides, and fullcustomComponentworkspace examples. - Kotlin: prebuilt Compose room,
returnUI = falsehandoff throughonParametersUpdate, andcustomComponentreplacement examples. - Swift: hosted controller launch, no-UI create/join entry flow with
autoProceed = true, and bridge-triggered audio/video/screen-share actions. - Unity: room join flow, explicit media backend attachment, and scene-owned media/runtime integration through the Unity client plus native WebRTC backend.
Deeper native resources
- Flutter: use the Flutter SDK for headless runtime, direct room helper calls,
uiOverrides,customComponent, and sandbox links. - Kotlin: use the Kotlin SDK for Compose-first room wiring, app-owned UI handoff, and custom room-surface patterns.
- Swift: use the Swift SDK, the Apple SDK repository it links to, and the native mediasoup client repository for package-level details and native media bridge context.
- Unity: use the Unity SDK, its linked SDK repository, and its API contract for scene integration and media backend details.
Native-safe production pattern
Across Flutter, Kotlin, Swift, and Unity, the production rule is the same even when the app wiring differs:
- Keep MediaSFU credentials off the client whenever the app is not meant to hold them directly.
- Put create and join behind a secure backend proxy when you need production-safe room lifecycle control.
- Validate the stock or fastest room flow first.
- Only then move into app-owned setup, custom workspaces, or scene-owned integration.
Minimum sequence
- Install the package or artifact from the matching SDK page.
- Choose cloud or self-hosted backend mode.
- Put a secure backend proxy in front of production create/join flows.
- Validate the first working path with the prebuilt/default integration.
- Only after that, move to headless mode or UI overrides.
Guardrails
- Do not start with heavy customization before a baseline join flow works.
- Do not ship frontend-held MediaSFU production credentials.
- Use the SDK page for package-specific caveats, dependencies, and platform setup.
- Test real-time features such as translation, whiteboard, screen share, and reconnect behavior in the app environments you plan to support.
- For native mobile and Unity paths, validate media permissions and capture behavior on real target devices, not only simulators or editor previews.