get

View as MarkdownOpen in Claude

Get a configuration value by dot-notation path. Environment variables are substituted in the returned value.

Parameters

key_path
strRequired

Dot-separated path to the config value (e.g., "security.ssl_enabled", "server.port").

default
AnyDefaults to None

Default value if the path is not found.

Returns

Any — The configuration value with environment variables substituted, or the default if not found.

Example

1from signalwire.core.config_loader import ConfigLoader
2
3loader = ConfigLoader(["config.json"])
4
5port = loader.get("server.port", 3000)
6ssl_enabled = loader.get("security.ssl_enabled", False)
7auth_user = loader.get("security.auth.basic.user", "signalwire")
8
9print(f"Port: {port}, SSL: {ssl_enabled}, User: {auth_user}")