---
title: "useConfig Hook"
description: "Access the application configuration passed to the top-level Provider"
url: https://developers.dhis2.org/docs/app-runtime/hooks/useConfig
source: https://github.com/dhis2/app-runtime/tree/master/docs/hooks/useConfig.md
---

# useConfig Hook

Access the application configuration passed to the top-level [Provider](https://developers.dhis2.org/docs/app-runtime/provider.md)

## Basic Usage:

```jsx
import { useConfig } from '@dhis2/app-runtime'

// Within a functional component body
const { baseUrl, apiVersion } = useConfig()
```

## Input

_None_

## Output

This hook returns an object of type [Config](https://developers.dhis2.org/docs/app-runtime/types/Config.md).

## Example

```jsx
import React from 'react'
import { useConfig } from '@dhis2/app-runtime'

export const MyComponent = () => {
    const { baseUrl, apiVersion } = useConfig()
    return
    ;<div>
        <span>
            <strong>Base URL</strong> : {baseUrl}
        </span>
        <span>
            <strong>API Version</strong> : {apiVersion}
        </span>
    </div>
}
```
