run

View as MarkdownOpen in Claude

Alias for serve(). Starts the Hono HTTP server and begins listening for requests.

Parameters

opts
object

Optional host and port overrides.

opts.host
string

Host to bind the server to. Falls back to the constructor’s host option.

opts.port
number

Port to listen on. Falls back to the constructor’s port option.

Returns

Promise<void> — Resolves once the server is running.

Example

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'my-agent', route: '/agent' });
4agent.setPromptText('You are a helpful assistant.');
5await agent.run();