Server SDKs
Build AI agents, control calls, send messages, and more
Render the current SWML document as a plain object. Delegates to the underlying SwmlBuilder’s getDocument() method.
getDocument()
None.
Record<string, unknown> — The SWML document with version and sections.
Record<string, unknown>
version
sections
1import { SWMLService } from '@signalwire/sdk';23const service = new SWMLService({ name: 'my-ivr' });4service.addVerb('answer', {});5service.addVerb('play', { url: 'https://example.com/greeting.mp3' });6service.addVerb('hangup', {});78const doc = service.renderSwml();9console.log(JSON.stringify(doc, null, 2));10// {11// "version": "1.0.0",12// "sections": {13// "main": [14// { "answer": {} },15// { "play": { "url": "https://example.com/greeting.mp3" } },16// { "hangup": {} }17// ]18// }19// }