MediaSFU React Native
This guide gives you the public setup path for the MediaSFU React Native package and points to generated API references when you need exact signatures or types.
Quick start
- Best for: Bare React Native mobile apps
- Package/artifact:
mediasfu-reactnative - Install:
npm i mediasfu-reactnative
Start in 60 seconds
- Install the package:
npm i mediasfu-reactnative - Pick backend mode: MediaSFU Cloud or self-hosted MediaSFU Open.
- Follow the first setup section below for your framework.
Before you continue
- Best for: Bare React Native mobile apps
- If you use Expo, prefer
/sdks/react-native-expo. - New to MediaSFU? Start at /sdks to compare frameworks quickly.
Copy/paste starter
Start with install + backend config, then follow the first integration section below.
npm i mediasfu-reactnative
export const mediaSFUConfig = {
// Cloud mode
credentials: {
apiUserName: process.env.MEDIASFU_API_USERNAME ?? '',
apiKey: process.env.MEDIASFU_API_KEY ?? '',
},
localLink: '',
connectMediaSFU: true,
};
export const mediaSFULocalConfig = {
// Self-hosted mode
credentials: undefined,
localLink: 'http://localhost:3000',
connectMediaSFU: true,
};
Do not skip this order
- Decide backend mode first: MediaSFU Cloud or self-hosted MediaSFU Open.
- Validate one successful create or join flow with the default room surface from this SDK.
- Only then customize the shell, cards, or room ownership model.
- Use the generated API reference when you need exact symbols or signatures, not as the first stop.
This order prevents most early confusion and keeps backend issues separate from UI customization work.
Choose your backend mode
| Mode | Best for | What you must provide |
|---|---|---|
| MediaSFU Cloud | Fastest onboarding, managed infrastructure, less operational work | Cloud credentials stored in secure runtime or build configuration. |
| MediaSFU Open / self-hosted | Private infrastructure, local control, custom deployment requirements | A self-hosted MediaSFU Open deployment plus the URL or config you pass into localLink or the equivalent connection setting. |
If you have not made this choice yet, make it before going deeper into customization or API reference material.
API reference
- Start with the portal overview at /api-reference.
- Use the MediaSFU React Native entry on that page to open the staged TypeDoc site for this package at
/api/react-native/.
Use the SDK guide for workflow guidance and the staged TypeDoc site for exact package details, generated symbols, and signatures.
Common setup mistakes
- Using Expo docs/snippets in a bare React Native CLI app.
- Device permission prompts not handled before media initialization.
- Testing on simulator/emulator only for camera/mic scenarios that require real devices.
- Backend endpoint unreachable (Cloud credentials invalid or self-hosted server offline).
- Credentials committed directly in source files instead of secure environment configuration.
If setup fails, verify install → backend mode → credentials/local link in that order.
Troubleshooting quick checks
| Check | Symptom | Quick fix |
|---|---|---|
| Backend mode mismatch | Join/create flow fails early | Confirm Cloud credentials for cloud mode, or set localLink for self-hosted mode. |
| Device permission not granted | Camera/mic unavailable | Re-check platform permissions and validate on a physical device. |
| Dependency mismatch | Build/install warnings | Reinstall dependencies and avoid force-install flags unless absolutely required. |
Use this table first before diving into deeper API sections.
Production readiness checklist
- Backend mode decided (Cloud vs self-hosted) and documented.
- Credentials/keys sourced from secure environment config (not hard-coded).
- Camera/microphone permissions validated on at least one physical device.
- Happy-path join/create flow validated end-to-end.
- Release build passes cleanly in the target app environment.
Mark all items before release.
MediaSFU React Native SDK · mediasfu-reactnative on npm
mediasfu-reactnative is the React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS and Android — powered by MediaSFU Cloud or your self-hosted MediaSFU Open server. Install with npm install mediasfu-reactnative.
MediaSFU React Native SDK
mediasfu-reactnative is the React Native package for shipping MediaSFU-powered calling, conferencing, webinar, broadcast, chat, screen sharing, whiteboard, recording, subtitle, translation, and AI-assisted room experiences on iOS and Android.
Use this package when you want one of these paths:
- render a prebuilt room with
MediasfuGeneric,MediasfuConference,MediasfuWebinar,MediasfuBroadcast, orMediasfuChat - render the same room runtime with the modern themed shell via
ModernMediasfuGeneric - keep the MediaSFU runtime and replace targeted UI surfaces with
uiOverrides, custom cards, and custom shells - run MediaSFU headless with
returnUI={false}and own the full native experience
Start Here
1. Install
npm install mediasfu-reactnative
2. Import & Render
import { MediasfuGeneric } from "mediasfu-reactnative";
export default function App() {
return (
<MediasfuGeneric
credentials={{ apiUserName: "your-api-username", apiKey: "your-api-key" }}
connectMediaSFU={true}
/>
);
}
Prefer the themed modern shell? Start with ModernMediasfuGeneric instead:
import { ModernMediasfuGeneric } from 'mediasfu-reactnative';
export default function App() {
return (
<ModernMediasfuGeneric
credentials={{ apiUserName: 'your-api-username', apiKey: 'your-api-key' }}
/>
);
}
3. Run
npx react-native run-android
# or
npx react-native run-ios
Want to try without a server? Use demo mode:
<MediasfuGeneric
useLocalUIMode={true}
useSeed={true}
seedData={{ member: "DemoUser", eventType: "conference" }}
/>
Backend Requirement
This SDK needs a MediaSFU-compatible backend for room lifecycle, signaling, and media routing.
| Option | Use it when | What to pass |
|---|---|---|
| MediaSFU Cloud | You want managed infrastructure | credentials={{ apiUserName, apiKey }} |
| MediaSFU Open / CE | You want to self-host | localLink="http://your-server:3000" and your own server config |
Cloud room helpers target https://mediasfu.com/v1/rooms/ by default. For self-hosted deployments, pass a non-MediaSFU localLink.
Integration Paths
- Keep the bundled room UI for the fastest route to production on iOS and Android.
- Use
ModernMediasfuGenericwhen you want the premium themed shell as your default entry point. - Replace targeted surfaces with
uiOverrides, custom cards, and custom shells. - Use
customComponentorreturnUI={false}when your app should own the entire native experience. - Expo users should use
mediasfu-reactnative-expofor the Expo-managed workflow.
Also Available: AI Phone Agents, SIP, and PSTN
MediaSFU supports AI phone agents and telephony workflows on the same platform. Call the live demos:
- 🇺🇸 +1 (785) 369-1724 — Mixed Support Demo