OBSERVERTC / Observer
Quick start
Observer runs in your backend. It receives samples from Client Monitor and keeps an up-to-date view of calls, participants, tracks, and their issues. Add it when you need to compare participants or keep call-level diagnostics.
Install
npm install @observertc/observer-jsCreate an Observer
import { Observer } from '@observertc/observer-js';
const observer = new Observer();
observer.on('call-added', ({ observedCall }) => {
console.log('Call:', observedCall.callId);
});
observer.on('client-issue', ({ observedClient, issue }) => {
console.log('Client:', observedClient.clientId, issue.type);
});Accept a sample
// Inside your authenticated and validated ingestion handler:
observer.accept(sample);sample is a decoded ClientSample with a nonempty callId and clientId. Observer creates the corresponding call and client when it first sees their identifiers, then updates them as more samples arrive.
Your application supplies the endpoint and transport. Authenticate the sender, check that it may report for those identifiers, and validate the payload before accepting it. accept() is synchronous and does not decode JSON/Protobuf codec streams for you.
Add analysis and history
A new Observer has no server detectors registered. Choose server detectors for cross-participant analysis. Add sinks for sample history or call summaries for a record of a completed call; live entities alone are not historical storage.
Call observer.close() during service shutdown. Continue with backend integration and configuration.