[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/core](../../README) / [index](../README) / config

# Function: config()

## Call Signature

> **config**\<`P`\>(`path`): [`ConfigValue`](../../config/type-aliases/ConfigValue)\<`P`\>

Defined in: [helpers/config.ts:21](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/helpers/config.ts#L21)

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented `ConfigRegistry`) are resolved by
the typed overloads first, so `config('app.name')` is inferred as `string`; a
plain `string` path falls through to the untyped escape-hatch overloads.

### Type Parameters

#### P

`P` *extends* [`ConfigPath`](../../config/type-aliases/ConfigPath)

### Parameters

#### path

`P`

### Returns

[`ConfigValue`](../../config/type-aliases/ConfigValue)\<`P`\>

## Call Signature

> **config**\<`P`\>(`path`, `fallback`): [`ConfigValue`](../../config/type-aliases/ConfigValue)\<`P`\>

Defined in: [helpers/config.ts:22](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/helpers/config.ts#L22)

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented `ConfigRegistry`) are resolved by
the typed overloads first, so `config('app.name')` is inferred as `string`; a
plain `string` path falls through to the untyped escape-hatch overloads.

### Type Parameters

#### P

`P` *extends* [`ConfigPath`](../../config/type-aliases/ConfigPath)

### Parameters

#### path

`P`

#### fallback

[`ConfigValue`](../../config/type-aliases/ConfigValue)\<`P`\>

### Returns

[`ConfigValue`](../../config/type-aliases/ConfigValue)\<`P`\>

## Call Signature

> **config**(`path`): `unknown`

Defined in: [helpers/config.ts:23](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/helpers/config.ts#L23)

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented `ConfigRegistry`) are resolved by
the typed overloads first, so `config('app.name')` is inferred as `string`; a
plain `string` path falls through to the untyped escape-hatch overloads.

### Parameters

#### path

`string`

### Returns

`unknown`

## Call Signature

> **config**\<`T`\>(`path`, `fallback`): `T`

Defined in: [helpers/config.ts:24](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/helpers/config.ts#L24)

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented `ConfigRegistry`) are resolved by
the typed overloads first, so `config('app.name')` is inferred as `string`; a
plain `string` path falls through to the untyped escape-hatch overloads.

### Type Parameters

#### T

`T`

### Parameters

#### path

`string`

#### fallback

`T`

### Returns

`T`
