> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # ConfigLoader > JSON configuration file loader with environment variable interpolation and dot-notation access. [load]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/load [search]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/search [get]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/get [has]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/has [getall]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-all [getfilepath]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-file-path [loadfromobject]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/load-from-object [set]: /docs/server-sdks/reference/typescript/agents/configuration/config-loader/set `ConfigLoader` loads JSON configuration files and substitutes environment variables using `${VAR|default}` syntax. It provides dot-notation access for nested values and supports method chaining. ```typescript {3} import { ConfigLoader } from '@signalwire/sdk'; const config = new ConfigLoader('./config.json'); const port = config.get('server.port', 3000); ``` ## **Constructor** **`filePaths`** `string | string[]` Path(s) to a JSON config file to load on construction. A single string is loaded directly; an array is searched in order and the first existing file is loaded (mirroring the Python SDK's ordered-search behaviour). If no file in the array exists, the paths are recorded but no error is thrown. If omitted, use [`load()`][load] or [`loadFromObject()`][loadfromobject] later. --- ## **Properties** **`configPaths`** `string[]` The ordered list of config file paths passed to the constructor or searched during loading. Returns a defensive copy. --- ## **Methods** #### [load](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/load) Load configuration from a JSON file with env var interpolation. #### [search](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/search) Static method to find and load a config file from standard locations. #### [get](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get) Get a value by dot-notation path. #### [set](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/set) Set a value at a dot-notation path. #### [has](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/has) Check whether a dot-notation path exists. #### [getAll](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-all) Return a shallow copy of the entire configuration object. #### [getFilePath](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-file-path) Return the absolute path of the loaded config file. #### [loadFromObject](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/load-from-object) Load configuration from a plain object instead of a file. #### [findConfigFile](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/find-config-file) Find a config file without loading it (static). #### [getConfig](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-config) Return the full config (Python-compat alias for getAll). #### [getConfigFile](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-config-file) Return the loaded file path (Python-compat alias for getFilePath). #### [hasConfig](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/has-config) Check whether any configuration data is loaded. #### [getSection](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-section) Get a top-level section with env-var substitution. #### [substituteVars](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/substitute-vars) Recursively substitute \$\{VAR} references with coercion. #### [mergeWithEnv](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/merge-with-env) Merge config with prefixed environment variables. #### [interpolateEnvVars](/docs/server-sdks/reference/typescript/agents/configuration/config-loader/interpolate-env-vars) Interpolate \$\{VAR} in a raw string without coercion. ## **Example** ```typescript {4,7-8} import { ConfigLoader } from '@signalwire/sdk'; // Load from a specific file const config = new ConfigLoader('./config.json'); console.log('File:', config.getFilePath()); const port = config.get('server.port', 3000); const host = config.get('server.host', '0.0.0.0'); console.log(`Listening on ${host}:${port}`); ``` > JSON configuration file loader with environment variable interpolation and dot-notation access. ## Docs - [findConfigFile](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/find-config-file.md): Find a config file path without loading it (static helper). - [get](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get.md): Retrieve a configuration value using a dot-notation path. - [getAll](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-all.md): Return a shallow copy of the entire configuration object. - [getConfig](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-config.md): Return a shallow copy of the entire configuration (Python-compat alias for getAll). - [getConfigFile](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-config-file.md): Return the path of the loaded config file (Python-compat alias for getFilePath). - [getFilePath](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-file-path.md): Return the absolute path of the loaded config file. - [getSection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/get-section.md): Get a configuration section with environment variables substituted. - [has](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/has.md): Check whether a dot-notation path exists in the loaded configuration. - [hasConfig](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/has-config.md): Check whether any configuration data is loaded (file or object). - [interpolateEnvVars](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/interpolate-env-vars.md): Interpolate ${VAR|default} patterns in a raw string. - [load](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/load.md): Load configuration from a JSON file with environment variable interpolation. - [loadFromObject](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/load-from-object.md): Load configuration from a plain object instead of a file. - [mergeWithEnv](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/merge-with-env.md): Merge configuration with prefix-matched environment variables. - [search](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/search.md): Search for a config file in standard locations and load it if found. - [set](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/set.md): Set a configuration value at a dot-notation path. - [substituteVars](https://signalwire.com/docs/server-sdks/reference/typescript/agents/configuration/config-loader/substitute-vars.md): Recursively substitute environment variables in any value.