Migrate from Agora/Zego to Monibuca
Why Migrate from Agora/Zego?
Section titled “Why Migrate from Agora/Zego?”More and more companies are looking for alternatives to Agora and Zego, primarily because of:
- Cost: Per-minute billing becomes prohibitively expensive at scale
- Data Privacy: Media data routes through third-party servers, failing compliance requirements
- Control: Dependency on third-party SDK limits customization and debugging
- Compliance: Government and enterprise clients require on-premises deployment
Monibuca is a high-performance open-source streaming engine built in Rust that provides API-compatible adapters for Agora and Zego, allowing you to:
- Use the exact same code to connect to your own servers
- Complete migration with zero code changes
- Enjoy zero cloud service fees with self-hosted deployment
One-Line Migration
Section titled “One-Line Migration”From Agora
Section titled “From Agora”// Before — using Agora SDKimport AgoraRTC from "agora-rtc-sdk-ng";
// After — using Monibuca adapter (all other code remains the same)import { AgoraRTC } from "@monibuca/adapter-agora";All your existing business logic, event listeners, and track operations work without any changes.
From Zego
Section titled “From Zego”// Before — using Zego SDKimport { ZegoExpressEngine } from "zego-express-engine-webrtc";
// After — using Monibuca adapter (all other code remains the same)import { ZegoExpressEngine } from "@monibuca/adapter-zego";Migration Steps
Section titled “Migration Steps”Step 1: Deploy Monibuca Server
Section titled “Step 1: Deploy Monibuca Server”# Download Monibucacurl -fsSL https://monibuca.com/install.sh | bash
# Start (listens on port 8080 by default)./monibucaStep 2: Install Adapter
Section titled “Step 2: Install Adapter”# If you're currently using Agoranpm uninstall agora-rtc-sdk-ngnpm install @monibuca/adapter-agora
# If you're currently using Zegonpm uninstall zego-express-engine-webrtcnpm install @monibuca/adapter-zegoStep 3: Change Imports
Section titled “Step 3: Change Imports”Global find-and-replace the import path (see examples above). No business code changes needed.
Step 4: Update Connection Parameters
Section titled “Step 4: Update Connection Parameters”Agora users: Change the first parameter of join() (originally appId) to your Monibuca server WebSocket URL
// Before — connecting to Agora cloudawait client.join("your-agora-app-id", "channel", token, uid);
// After — connecting to Monibucaawait client.join("ws://your-server:8080", "channel", null, uid);Zego users: Change the server parameter to your Monibuca server URL
// Before — connecting to Zego cloudconst zg = new ZegoExpressEngine(appID, "wss://xxx.zego.im/ws");
// After — connecting to Monibucaconst zg = new ZegoExpressEngine(0, "ws://your-server:8080");API Compatibility
Section titled “API Compatibility”Agora Adapter Coverage
Section titled “Agora Adapter Coverage”| Category | Supported Methods |
|---|---|
| Client | createClient, join, leave, publish, unpublish, subscribe, unsubscribe |
| Track Creation | createMicrophoneAudioTrack, createCameraVideoTrack, createScreenVideoTrack, createMicrophoneAndCameraTracks |
| Device Management | getCameras, getMicrophones, getPlaybackDevices, checkSystemRequirements |
| Track Control | play, stop, close, setEnabled, setVolume, setDevice |
| Events | user-joined, user-left, user-published, user-unpublished, connection-state-change |
Zego Adapter Coverage
Section titled “Zego Adapter Coverage”| Category | Supported Methods |
|---|---|
| Room | loginRoom, logoutRoom |
| Publishing | createZegoStream, createStream, startPublishingStream, stopPublishingStream |
| Playing | startPlayingStream, stopPlayingStream |
| Devices | enumDevices, useAudioDevice, useVideoDevice |
| Messaging | sendBroadcastMessage |
| Events | roomStateChanged, roomUserUpdate, roomStreamUpdate, publisherStateUpdate, playerStateUpdate, publishQualityUpdate, playQualityUpdate, IMRecvBroadcastMessage |
Unsupported Features
Section titled “Unsupported Features”The following cloud service features are outside the adapter scope:
- Cloud Recording (use Monibuca’s MP4 plugin instead)
- CDN Relay (Monibuca natively supports RTMP/HLS distribution)
- Content Moderation (integrate third-party services)
- Token Authentication (Monibuca has its own auth system)
- Beauty Filters/Virtual Background (Monibuca Web SDK has built-in AI effects)
How does performance compare to Agora/Zego?
Section titled “How does performance compare to Agora/Zego?”Monibuca uses standard WHIP/WHEP protocols with end-to-end latency typically 200-500ms (same tier as Agora/Zego). The Rust-based server achieves extremely high performance — a single node can handle thousands of concurrent streams.
Do I need to maintain my own servers?
Section titled “Do I need to maintain my own servers?”Yes, Monibuca is a self-hosted solution. The benefits are complete data control, zero recurring fees, and full scalability. Best suited for organizations with ops teams.
Can I migrate incrementally?
Section titled “Can I migrate incrementally?”Yes. You can use both the original vendor SDK and the Monibuca adapter in the same project, routing traffic by room/channel as needed.
What about browser compatibility?
Section titled “What about browser compatibility?”Same as Agora/Zego — all modern browsers (Chrome, Firefox, Safari, Edge). It’s all WebRTC underneath.
Full API Documentation
Section titled “Full API Documentation”See the complete interface documentation and usage examples: Web SDK Adapters API Reference