Skip to navigation

document

View as MarkdownOpen in Claude

Read-only getter for the underlying SWML document object. Provides direct access to the mutable document (the returned reference is the internal object, not a copy).

Prefer build() when you want an explicit method call for symmetry with other accessors. The document getter exists for callers that want property-style access.

Type

{ version: string; sections: Record<string, unknown[]> }

Example

import { SwmlBuilder } from '@signalwire/sdk';
const builder = new SwmlBuilder();
builder.answer();
console.log(builder.document.version); // "1.0.0"
console.log(builder.document.sections.main.length); // 1