set

View as MarkdownOpen in Claude

Set a configuration value at the given dot-notation path, creating intermediate objects as needed. Keys matching __proto__, constructor, or prototype are silently ignored to prevent prototype pollution.

Parameters

path
stringRequired

Dot-separated key path into the config object (e.g., "server.port").

value
unknownRequired

The value to store at the given path.

Returns

ConfigLoader — Returns this for method chaining.

Example

import { ConfigLoader } from '@signalwire/sdk';
const config = new ConfigLoader();
config.set('server.port', 8080);
config.set('server.host', 'localhost');
console.log(config.get<number>('server.port')); // 8080