run

View as MarkdownOpen in Claude

Start the HTTP server and begin listening for requests. Uses @hono/node-server to serve the Hono application with all registered agents.

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().

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();