Expo Compact Call Tutorial
Build a mobile call with mediasfu-reactnative-expo@2.5.0. The supplied Generic room gives a join screen, people list, microphone, camera, screen sharing where supported, remote media, leave, and host end.
Prerequisites
- Node.js 22.11 or newer, Expo SDK 57, and an Android or iOS device for final media checks.
- An HTTPS endpoint in your signed-in app with
/api/mediasfu/create-roomand/api/mediasfu/join-room.
Project files
Use the complete Expo starter app. It contains every file needed for this package. On its first screen, choose Compact call; the supplied room opens through the secured application backend.
npx create-expo-app@3.5.0 my-mediasfu-expo-app --template blank-typescript
cd my-mediasfu-expo-app
The temporary token field is solely for an isolated authority-server check. It is an app-session token, never a MediaSFU credential. A distributed app uses its normal signed-in session and backend-held MediaSFU credentials.
Run
cd my-mediasfu-app
npm install
npm run android
Expected result
Choose Compact call, enter the HTTPS app-backend address and short-lived app token, then create or join. Two devices can test people, microphone, camera, screen share, leave, and host end.
Recovery
- Return to app sign-in after 401 or 403; never request a Cloud key from the user.
- Keep the person in the room if device permission is denied and let them retry capture.
- Check the device output route and the other participant’s microphone before reconnecting for silent audio.
Cleanup
Use Leave for one participant and End only for the authorized room-wide action. Clear app-owned room state, timers, and subscriptions after exit; the backend expires authority by policy.