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
          • findConfigFile
          • get
          • getAll
          • getConfig
          • getConfigFile
          • getFilePath
          • getSection
          • has
          • hasConfig
          • interpolateEnvVars
          • load
          • loadFromObject
          • mergeWithEnv
          • search
          • set
          • substituteVars
        • 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
  • Parameters
  • Returns
  • Example
AgentsConfigurationConfigLoader

getSection

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

has

Next
Built with

Get an entire top-level configuration section with all ${VAR|default} environment-variable references substituted. Internally calls substituteVars() on the resolved value.

Returns an empty object ({}) if the section does not exist or is not an object. For single-value lookups, use get() instead.

Parameters

section
stringRequired

The top-level section name (e.g., "security", "server").

Returns

Record<string, unknown> — the configuration section, with env-var substitution applied; empty object if the section is missing or not an object.

Example

1import { ConfigLoader } from '@signalwire/sdk';
2
3// Given config.json:
4// { "server": { "host": "${HOST|0.0.0.0}", "port": "${PORT|3000}" } }
5
6const loader = new ConfigLoader('config.json');
7
8const serverCfg = loader.getSection('server');
9console.log(serverCfg.host); // "0.0.0.0" (or HOST env var)
10console.log(serverCfg.port); // 3000 (coerced to number)