For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
        • getAgent
        • getAgents
        • getApp
        • register
        • registerGlobalRoutingCallback
        • run
        • serveStaticFiles
        • setupSipRouting
        • unregister
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
AgentsAgentServer

run

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

serveStaticFiles

Next
Built with

Start the HTTP server and begin listening for requests. Uses @hono/node-server to serve the Hono application with all registered agents. Handles server mode only — for serverless deployments (AWS Lambda, Google Cloud Functions, Azure Functions), use ServerlessAdapter instead.

Parameters

host
string

Override the configured hostname.

port
number

Override the configured port.

Returns

Promise<void> — Resolves after starting the HTTP server.

For custom server setups — such as embedding the agents into an existing Hono application — use getApp() to retrieve the underlying Hono app and pass its fetch handler to your own @hono/node-server serve() call instead of using run().

When the environment variable SWAIG_CLI_MODE=true is set (used by the swaig-test CLI tool), run() returns immediately without starting the server so only the agent configuration is loaded.

Example

1import { AgentBase, AgentServer } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'my-agent', route: '/agent' });
4agent.setPromptText('You are a helpful assistant.');
5
6const server = new AgentServer({ host: '0.0.0.0', port: 3000 });
7server.register(agent);
8await server.run();