> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# render

> Render the SWML document as a JSON string (Python-compat alias for renderDocument).

[ref-renderdocument]: /docs/server-sdks/reference/typescript/agents/swml-builder/render-document

[ref-build]: /docs/server-sdks/reference/typescript/agents/swml-builder/build

Render the SWML document as a JSON string. Python-compat alias for
[`renderDocument()`][ref-renderdocument]; the two are functionally identical.
Use `render()` when porting from the Python SDK. For the document as a plain
object, use [`build()`][ref-build] or `getDocument()`.

## **Returns**

`string` -- JSON-serialized SWML document.

## **Example**

```typescript {6}
import { SwmlBuilder } from '@signalwire/sdk';

const builder = new SwmlBuilder();
builder.answer();
builder.ai({ prompt: { text: 'You are a helpful assistant.' } });

const json = builder.render();
console.log(json);
// '{"version":"1.0.0","sections":{"main":[{"answer":{}},{"ai":{...}}]}}'
```