manualSetProxyUrl

View as MarkdownOpen in Claude

Manually set the proxy URL base used when constructing webhook callback URLs in the SWML document. Use this when your agent is behind a reverse proxy, tunnel, or load balancer and the auto-detected URL is incorrect.

You can also set the SWML_PROXY_URL_BASE environment variable for the same effect without calling this method.

Parameters

url
stringRequired

The external-facing base URL (e.g., "https://abc123.ngrok.io"). Trailing slashes are automatically stripped.

Returns

AgentBase — Returns this for method chaining.

Example

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.manualSetProxyUrl('https://abc123.ngrok.io');
6await agent.serve();