exportDiagnostics

View as MarkdownOpen in Claude
exportDiagnostics(): 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

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

Attach diagnostics to a support form

supportForm.addEventListener('submit', async (e) => {
e.preventDefault();
await fetch('/api/support', {
method: 'POST',
body: JSON.stringify({
message: messageInput.value,
diagnostics: client.exportDiagnostics(),
}),
});
});