exportDiagnostics

View as MarkdownOpen in Claude
1exportDiagnostics(): SessionDiagnostics

Snapshots the client’s accumulated diagnostic data into a single serializable bundle — connection events, recent call summaries, and device-change history — for inclusion in support tickets or local debug exports.

The returned object is a plain JSON-serializable structure; safe to JSON.stringify and ship to a support endpoint.

Returns

SessionDiagnostics — a structured snapshot containing connection events, call summaries, and device change history at the moment of the call.

Examples

Download the diagnostics bundle

1const diag = client.exportDiagnostics();
2const blob = new Blob([JSON.stringify(diag, null, 2)], { type: 'application/json' });
3const url = URL.createObjectURL(blob);
4Object.assign(document.createElement('a'), { href: url, download: 'signalwire-diag.json' }).click();
5URL.revokeObjectURL(url);

Attach diagnostics to a support form

1supportForm.addEventListener('submit', async (e) => {
2 e.preventDefault();
3 await fetch('/api/support', {
4 method: 'POST',
5 body: JSON.stringify({
6 message: messageInput.value,
7 diagnostics: client.exportDiagnostics(),
8 }),
9 });
10});