Quickstart
Get a live room running in about five minutes. Pick the path that fits how you work:
- No SDK: create a room with one HTTP request and open the link it returns.
- React: drop the prebuilt room into a new app.
- Angular, Vue, mobile, Unity and more: install your package and open its first-room guide.
All three start with the same credentials.
1. Get your API credentials
- Create a MediaSFU account, or sign in.
- Open API keys and copy your API username and API key.
- Keep both out of source control. For this quickstart, store them as environment variables:
export MEDIASFU_API_USERNAME="your-api-username"
export MEDIASFU_API_KEY="your-api-key"
2. Option A: create a room over HTTP (no SDK)
Every room starts with one request to the rooms endpoint:
curl -X POST https://mediasfu.com/v1/rooms/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"create","userName":"host","duration":30,"capacity":5,"eventType":"conference"}'
A successful response looks like this:
{
"success": true,
"roomName": "m-9f3a2b7c",
"meetingID": "m-9f3a2b7c",
"secureCode": "A1B2C3",
"publicURL": "https://…"
}
Open publicURL in two browser tabs. You now have a live room with camera, microphone, chat and screen sharing, with no front-end code to maintain.
| Field | What it controls |
|---|---|
userName | The host of the room. Must be unique among your active rooms. |
duration | Minutes the room stays open, from 5 to 1440. |
capacity | Maximum participants. |
eventType | conference (everyone can speak), webinar (host and panel speak), broadcast (one-to-many), or chat (private 1:1). |
Every room option is listed in the Rooms API reference. To try requests live and copy them in other languages, use the API Sandbox.
2. Option B: add the prebuilt room to a React app
Create an app and install the SDK:
npm create vite@latest my-room -- --template react-ts
cd my-room
npm install mediasfu-reactjs@4.3.7
Add your credentials to .env.local in the project folder:
VITE_MEDIASFU_API_USERNAME=your-api-username
VITE_MEDIASFU_API_KEY=your-api-key
Replace src/App.tsx:
import { ModernMediasfuGeneric } from 'mediasfu-reactjs';
import 'mediasfu-reactjs/dist/main.css';
export default function App() {
return (
<ModernMediasfuGeneric
credentials={{
apiUserName: import.meta.env.VITE_MEDIASFU_API_USERNAME,
apiKey: import.meta.env.VITE_MEDIASFU_API_KEY,
}}
/>
);
}
Run it:
npm run dev
Open the local address Vite prints and create a room. To add a second participant, open another browser tab and join with the room ID shown in the room.
Vite builds VITE_ variables into the browser bundle, so anyone who loads the app can read them. Use this setup only on your own machine. Before you share or deploy the app, move room creation to your backend with the secure backend guide. The room component stays the same; only the credential handling moves.
2. Option C: install a package for your platform
Every platform guide below starts with installation and a working room.
| Platform | Install | First room |
|---|---|---|
| Angular | npm install mediasfu-angular@2.4.1 | Angular room |
| Vue | npm install mediasfu-vue@1.2.1 | Vue room |
| React Native | npm install mediasfu-reactnative@2.4.5 | React Native room |
| Expo | npm install mediasfu-reactnative-expo@2.5.5 | Expo room |
| Flutter | mediasfu_sdk: 2.3.6 in pubspec.yaml | Flutter SDK |
| Android | com.mediasfu:mediasfu-sdk-android:1.0.7 | Android SDK |
| Kotlin Multiplatform | com.mediasfu:mediasfu-sdk:1.0.7 | Kotlin room |
| Swift / Apple | Swift Package Manager | Swift SDK |
| Unity | Unity package | Unity room |
| Your own framework | npm install mediasfu-shared@1.2.5 | Shared core room |
3. Next steps
- Ship it safely: move credentials to your backend with the secure backend guide.
- Make it yours: change branding, controls or the whole layout with Choose your UI mode.
- Add features: recording, breakout rooms, moderation and more in Build by outcome.
- Stream in or out: bring in OBS or a hardware encoder with WHIP, play a room in any WebRTC player with WHEP, or reach large audiences with HLS in Stream in and out.
- Start from a full app: clone a starter project.