Why WebRTC is harder than it looks
WebRTC lets browsers exchange audio, video and data directly. The browser API fits on a page, so a video call looks like a weekend project. It rarely is. Before two users see each other reliably, you have to build or run all of this:
- Signalling. Browsers cannot find each other on their own. They exchange offers, answers and network candidates through a server you provide, usually over WebSocket, with authentication, reconnection and presence: who is online and in which room.
- STUN. Most users sit behind NAT. A STUN server tells a browser its public address so that a direct path can be tried.
- TURN. When a direct path is impossible, behind a corporate firewall or a strict mobile network, traffic has to go through a TURN relay. It carries the media itself, so it costs bandwidth, needs credentials that expire and has to be close to your users.
- Concurrency. Two participants call each other at the same moment; a user joins while another leaves; a connection drops halfway through negotiation. Without care these races end in duplicate connections, one-way audio or a call that never starts. WebRTC's own answer, “perfect negotiation”, is subtle to get right.
- Scale of a room. In a full mesh each of n participants sends its stream n − 1 times. Past a handful of people, upload bandwidth runs out and you need relaying or a media server.
- Devices and permissions. Camera and microphone prompts, switching devices, a phone's front and back camera, screen sharing that the user stops from the browser's own bar, and differences between Chrome, Safari and Firefox.
- Reconnection and diagnostics. Networks change: Wi-Fi to mobile, a laptop wakes up. Connections must be restored, and when something fails you need to know why.
None of this is your product. It is plumbing that has to work before your product can start. Weei is that plumbing, already running, with tools on top.
What Weei gives you
Weei is a JavaScript library and a hosted service. Your page loads one script; participants on the same site and in the same room find each other and connect over WebRTC. Signalling, STUN and TURN, connection races, relaying and reconnection are handled by Weei. Your code works with participants, media streams and widgets.
1. Register your application
Sign in to the control panel, Weei-CP, with Google, GitHub or Facebook. New accounts are created on first sign-in.

Open Sites and choose Add site. Enter a name and your site's address, with the port if it uses one. Weei works only on the origins you register, so add your local development address and your production address separately.

In the site's Widgets tab you choose which widgets the site may use and who can use each of them.

2. Add Weei to your page
This is the whole integration, from the Get Started guide. Serve the page over HTTPS from the origin you registered.
<script type="module">
const loaderUrl = 'https://weei-core.web.app/loader.min.js';
window.weeiReady = (async () => {
const { loadWeei } = await import(loaderUrl + '?t=' + Date.now());
const weei = await loadWeei();
weei.setVisibility(true);
return weei;
})();
</script>Open the page in two browser tabs: both show Weei's control panel and see each other as participants. From there users can call each other, share the screen and open widgets. To show your own users' names, call setUser().
3. Use the widgets
Widgets are ready-made tools that run over the same connections. Enable the ones you need in Weei-CP; many also have an API for your code.
| Widget | What it does |
|---|---|
| Chat | Messages, files, voice and video messages. |
| Screen share | Share a screen or window with the participants. |
| Shared control | Use your site together: everyone can click, type and scroll on the same page. |
| Whiteboard and Sketch | Draw over your page or on a shared sheet. |
| Recording Demos | Record and replay walkthroughs, capture issues with your app's events. |
| Notes, Shared document preview, Transcription | Meeting notes, reviewing a file together and live speech-to-text. |
| Voting, Planning poker, Retrospective board, Approval cards | Polls, estimates, retrospectives and decisions. |
| Reactions, Raise hand | Emoji reactions and a queue of raised hands. |
| AI assistant | An AI chat inside your page. |
| Distributed Neural Training | Train a model together in participants' browsers. |
| Connection diagnostics | Ping, network map and connection logs. |
The full list with APIs is in Built-in widgets. Opening one from your own button is a single call:
const weei = await window.weeiReady;
weei.widgetsApi.open('chat');4. Need something specific? Build a widget
If no built-in widget fits, you do not have to fall back to raw WebRTC. A site widget is a class in your own code that sends messages to the other participants over Weei's connections and shows its UI in a Weei window. You write the feature; Weei delivers the messages.
const weei = await window.weeiReady;
await weei.addWidget(CounterWidget); // your class: a connector and a UIThe Build a site widget tutorial builds a counter shared by everyone in the session, step by step.
5. Your interface, Weei underneath
Weei's interface is optional. Call setVisibility(false) and none of it is built: your page draws its own call screen and uses Weei's APIs for participants, rooms and media.
const weei = await window.weeiReady;
weei.setVisibility(false); // no Weei UI on the page
await weei.media.setCamera(true);
await weei.media.setMicrophone(true);
weei.media.subscribe(({ local, remote }) => {
document.querySelector('#me').srcObject = local.camera;
// remote: each connected participant's MediaStream, by peer ID
});See Peers, rooms and media for connecting participants, rooms and media streams.
Build it or embed it
| Your own WebRTC stack | Weei | |
|---|---|---|
| Signalling and presence | A server you build, host and scale | Hosted |
| STUN and TURN | Run or buy, rotate credentials | Included |
| Connection races and reconnection | Your code | Handled |
| Rooms beyond a few people | Media server or relaying | Handled |
| Chat, screen sharing, whiteboard, shared control | Each built from scratch | Widgets, enabled in Weei-CP |
| Custom features | Your code on top of your stack | Site widgets on Weei's connections |
| Your own interface | Yes | Yes, with setVisibility(false) |
Get started
Register your site in Weei-CP, follow Get Started, and open the page in two tabs. Questions about your case? Contact us.