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
      • Configuration
        • AuthHandler
        • ConfigLoader
        • Environment Variables
        • Logging
        • PromptManager
        • SchemaUtils
        • ServerlessAdapter
        • SessionManager
        • SslConfig
      • 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
  • Config File Discovery
  • Key Configuration Areas
  • Quick Example
Agents

Configuration

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

AuthHandler

Next
Built with

The SignalWire Agents SDK uses a layered configuration system. Settings can come from constructor parameters, environment variables, JSON config files, or sensible defaults. The layers are resolved in priority order:

  1. Constructor parameters — highest priority
  2. Environment variables — override config file values
  3. Config file values — loaded from JSON
  4. Defaults — built-in fallback values
1import { ConfigLoader } from '@signalwire/sdk';
2
3// Constructor parameters take precedence over everything else
4const config = new ConfigLoader('./my_config.json');
5const port = config.get<number>('server.port', 3000);

Config File Discovery

When no explicit config file path is provided, the SDK searches for JSON config files using ConfigLoader.search(), which checks these locations in order:

  1. Current working directory
  2. ./config/
  3. ~/.signalwire/

See ConfigLoader for the full file discovery logic and environment variable substitution syntax.

Key Configuration Areas

AreaConfigured ViaReference
Server port, host, routeConstructor, PORT env var, config fileEnvironment Variables
AuthenticationSWML_BASIC_AUTH_* env vars, config fileAuthHandler
CORS and host allowlistsSWML_CORS_ORIGINS, SWML_ALLOWED_HOSTS env varsEnvironment Variables
LoggingSIGNALWIRE_LOG_MODE, SIGNALWIRE_LOG_LEVEL env varsEnvironment Variables
RELAY / REST authSIGNALWIRE_PROJECT_ID, SIGNALWIRE_API_TOKEN, SIGNALWIRE_SPACEEnvironment Variables

Quick Example

1{
2 "service": {
3 "name": "support-agent",
4 "host": "0.0.0.0",
5 "port": 8080,
6 "route": "/support"
7 },
8 "security": {
9 "basic_auth": {
10 "username": "${AUTH_USER|support_agent}",
11 "password": "${AUTH_PASSWORD}"
12 }
13 },
14 "agent": {
15 "auto_answer": true,
16 "record_call": false
17 },
18 "skills": [
19 { "name": "datetime" },
20 {
21 "name": "native_vector_search",
22 "params": {
23 "index_file": "./support_docs.swsearch",
24 "tool_name": "search_support"
25 }
26 }
27 ]
28}
Environment Variables

Complete reference for all environment variables used by the SDK.

ConfigLoader

JSON config file loading with environment variable substitution.

AuthHandler

HTTP Basic Auth, Bearer tokens, and API key authentication for Hono middleware.

PromptManager

Manages agent prompt text with raw text and structured POM-based prompts.

SchemaUtils

SWML document validation against structural rules with result caching.

ServerlessAdapter

Adapts Hono apps for AWS Lambda, Google Cloud Functions, and Azure Functions.

SessionManager

Stateless HMAC-SHA256 token generation and validation for SWAIG function calls.

SslConfig

SSL/TLS configuration for HTTPS serving with HSTS support.

Logging

Structured logging with Logger class and global configuration functions.