SWMLService
SWMLService is a lightweight HTTP service for serving non-AI SWML documents.
Unlike AgentBase (which always produces an AI block), SWMLService
generates pure SWML call-flow documents: IVR menus, voicemail, call recording, etc.
It uses a SwmlBuilder internally for verb construction and
Hono for HTTP serving.
SWMLService generates and serves SWML documents over HTTP. See the SWML reference for the full document specification.
Constructor
opts
Optional configuration object.
opts.name
Service display name used in logging and startup messages.
opts.route
HTTP route path where the service is accessible.
opts.basicAuth
Basic auth credentials as [username, password]. Unlike AgentBase,
SWMLService does not fall back to environment variables — credentials
must be provided explicitly.
Properties
name
Service display name.
route
HTTP route path where this service is accessible.
Methods
Add a SWML verb to the document.
Render the SWML document as an object.
Set a per-request callback for dynamic SWML generation.
Get the Hono app for mounting or testing.
Get the underlying SwmlBuilder instance.
Start the HTTP server.