OBSERVERTC / Overview

Quick start

Add monitoring to an existing WebRTC connection.

ObserveRTC is a set of libraries for WebRTC monitoring. Start in the browser with Client Monitor. Add sample transport and Observer when you need analysis across participants.

Before you begin

Use an existing browser application with a live RTCPeerConnection. Start media through your application as usual. You should have Node.js and npm available to install the package.

Install Client Monitor

npm install @observertc/client-monitor-js

Use your application’s existing RTCPeerConnection:

import { ClientMonitor } from '@observertc/client-monitor-js';

const monitor = new ClientMonitor({
  clientId: 'participant-42',
  callId: 'room-123',
});
monitor.addSource(peerConnection);

monitor.on('stats-collected', () => {
  console.log('Receiving video (bps):', monitor.receivingVideoBitrate);
  console.log('Quality score:', monitor.score);
});
monitor.on('issue', issue => console.log(issue.type, issue.payload));

// Call monitor.close() when the session ends.

Collection and sampling both default to five seconds. Rates need successive measurements; missing values and initial sentinel values are not healthy measurements.

Confirm the result

After successive collections, the console should show the receiving video bitrate for an active received video stream and a quality score. If no video is being received, inspect the media direction before expecting a receiving bitrate. Do not substitute zero for an unavailable measurement.

Continue with Inspect monitoring results to interpret the output.

Send samples when you need a backend

monitor.on('sample-created', ({ sample }) => {
  // Use your application's authenticated, ordered transport.
  sendSample(sample);
});

sendSample is application code. Client Monitor does not choose your server, transport or storage. Subscribe before the first sample; buffering samples before a subscriber is opt-in.

On the server:

npm install @observertc/observer-js
import { Observer } from '@observertc/observer-js';

const observer = new Observer();

// After your endpoint authenticates and validates an incoming sample:
observer.accept(sample);

// Call observer.close() during application shutdown.

Both clientId and callId must be present for Observer ingestion. Register server detectors explicitly: a new Observer has none.

Next steps

Read the monitor graph

Find a track, RTP stream, codec or selected ICE path.

Choose detectors

Understand the five categories and their evidence.

Define the wire contract

See what is and is not serialized.

Sources: ClientMonitor, Observer.accept.

Version coverage varies by reference. Source revisions · Markdown source