---
title: "useCurrentUserInfo Hook"
description: "Access the current authenticated DHIS2 user's information from the Provider"
url: https://developers.dhis2.org/docs/app-runtime/hooks/useCurrentUserInfo
source: https://github.com/dhis2/app-runtime/tree/master/docs/hooks/useCurrentUserInfo.md
---

# useCurrentUserInfo Hook

Access the current authenticated DHIS2 user's information from the [Provider](https://developers.dhis2.org/docs/app-runtime/provider.md)

## Basic Usage:

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

// Within a functional component body
const user = useCurrentUserInfo()
```

## Input

_None_

## Output

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

## Example

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

export const MyComponent = () => {
    const user = useCurrentUserInfo()
    return (
        <div>
            <span>
                <strong>Display Name</strong> : {user.displayName}
            </span>
            <span>
                <strong>Username</strong> : {user.username}
            </span>
        </div>
    )
}
```
