v150 · WebRTC

Bug-report companion

When a user reports a broken call, you want the browser's diagnostics and your app's context lined up. Start a session with structured metadata and stamp the returned session ID onto your bug report. The current spec caps metadata at 5 entries with keys/values ≤ 100 characters — exceed it and startDiagnosticLogging() throws a TypeError synchronously, before any session starts. The rewrite dropped the old allowUpload option and the finishDiagnosticLogging() name: authorisation is implementation-defined, and the session is closed with stopDiagnosticLogging().

Session options

metadata (record<string, string>)

KeyValue

Configure metadata and start a session.

Bug report — auto-stamped with the session ID

rtc-log: (none yet)

Start a session to generate a bug-report stub.
const sessionId = RTCPeerConnection.startDiagnosticLogging({
  metadata: {                      // ≤ 5 entries, keys/values ≤ 100 chars
    app: "acme-meet",              // otherwise a TypeError is thrown synchronously
    version: "4.7.1",
    callId: "c-88213",
  },
});
fileBugReport({ rtcDiagnosticId: sessionId });   // attach ID, like a crash ID

RTCPeerConnection.stopDiagnosticLogging();       // finalise the local log

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗