@applooma/rtc-web
v0.4.10
Published
AppLooma RTC Web SDK — real-time voice, video, live streaming and audio rooms for the browser
Maintainers
Readme
@applooma/rtc-web
AppLooma RTC Web SDK — add real-time voice, video, live streaming and audio rooms to any web app.
Install
npm install @applooma/rtc-webQuickstart
1. Get a token from your server (never put your API secret in the browser):
// Your backend calls AppLooma RTC:
// POST https://api.applooma.dev/v1/token
// headers: x-applooma-key, x-applooma-secret
// body: { roomName: "my-room", identity: "user-123", role: "host" }
// → { token, wsUrl, roomName, expiresAt }2. Join a channel:
import AppEngine from '@applooma/rtc-web';
const engine = AppEngine.create({ appId: 'YOUR_APP_ID' });
engine.on('track-subscribed', (track, user) => {
document.body.appendChild(track.attach());
});
engine.on('user-left', (user) => console.log(user.uid, 'left'));
const { token, wsUrl } = await fetch('/api/rtc-token').then(r => r.json());
await engine.joinChannel(token, wsUrl, { role: 'host', camera: true });3. Controls:
await engine.enableCamera(false); // mute video
await engine.enableMicrophone(false); // mute audio
await engine.enableScreenShare(true); // share screen
await engine.sendData('hello'); // realtime data (chat/gifts)
await engine.leaveChannel();Video quality
1080p at 4 Mbps by default (720p at 2.2 Mbps, 1440p preset at 5 Mbps). Choose what
the encoder gives up first with degradation, cap it with maxBitrate, and watch
video-quality-changed. codec: 'h265' and 'av1' are used where the browser can
encode them, with a VP8 backup layer kept.
const engine = AppEngine.create({
appId: 'YOUR_APP_ID',
video: { height: 1080, fps: 30, maxBitrate: 4_000_000, degradation: 'keep-resolution' },
});Roles
| Role | Publish | Notes |
|---|---|---|
| host | ✅ | Room admin |
| cohost | ✅ | Publisher, no admin |
| audience | ❌ | View/listen only — use for live streaming viewers |
Docs
Full documentation: https://applooma.dev/dashboard/docs
