***

title: load
slug: /reference/typescript/agents/configuration/config-loader/load
description: Load configuration from a JSON file with environment variable interpolation.
max-toc-depth: 3
---------------------

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

Load configuration from a JSON file, performing `${VAR|default}` environment
variable interpolation on the raw text before parsing. Returns `this` for
method chaining.

## **Parameters**

<ParamField path="filePath" type="string" required={true} toc={true}>
  Path to the JSON config file. Resolved to an absolute path internally.
  Throws an error if the file does not exist.
</ParamField>

## **Returns**

`this` -- The ConfigLoader instance for chaining.

## **Example**

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

const config = new ConfigLoader();
config.load('./config.json');

const port = config.get<number>('server.port', 3000);
console.log('Port:', port);
```