> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# getSection

> Get a configuration section with environment variables substituted.

[ref-substitutevars]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/substitute-vars

[ref-get]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/get

Get an entire top-level configuration section with all
`${VAR|default}` environment-variable references substituted. Internally
calls [`substituteVars()`][ref-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()`][ref-get] instead.

## **Parameters**

<ParamField path="section" type="string" required={true} toc={true}>
  The top-level section name (e.g., `"security"`, `"server"`).
</ParamField>

## **Returns**

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

## **Example**

```typescript {8}
import { ConfigLoader } from '@signalwire/sdk';

// Given config.json:
//   { "server": { "host": "${HOST|0.0.0.0}", "port": "${PORT|3000}" } }

const loader = new ConfigLoader('config.json');

const serverCfg = loader.getSection('server');
console.log(serverCfg.host); // "0.0.0.0" (or HOST env var)
console.log(serverCfg.port); // 3000 (coerced to number)
```