> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modelence.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getConfig

[API Reference](/api-reference/modelence/server/functions/../../../index) / [modelence](/api-reference/modelence/server/functions/../../index) / [server](/api-reference/modelence/server/functions/../index) / getConfig

> **getConfig**(`key`): `undefined` | `string` | `number` | `boolean`

Defined in: [packages/modelence/src/config/server.ts:43](https://github.com/modelence/modelence/blob/dcea4170315a023a7e8f0c3c5d551c26b7adecf3/packages/modelence/src/config/server.ts#L43)

## Parameters

| Parameter | Type     | Description                       |
| --------- | -------- | --------------------------------- |
| `key`     | `string` | The configuration key to retrieve |

## Returns

`undefined` | `string` | `number` | `boolean`

The configuration value (string, number, or boolean)

## Sidebar Title

getConfig (server)

## Examples

```ts theme={null}
import { getConfig } from 'modelence/server';

// Get the site URL
const siteUrl = getConfig('_system.site.url');
```

Set via environment variable:

```bash theme={null}
MODELENCE_SITE_URL=https://myapp.com
```

```ts theme={null}
import { getConfig } from 'modelence/server';

// Get the current environment (e.g., 'development', 'staging', 'production')
const env = getConfig('_system.env');

if (env === 'production') {
  // Enable production features
}
```

Set via environment variable:

```bash theme={null}
MODELENCE_SITE_ENV=production
```
