---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/users/details
title: Manage user details
updated_at: 2026-06-15T12:11:36.018Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Manage user details

Retrieve user details from your app.

## Get user details

`getUser()` returns data about a specific user, including all custom metadata by default.

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) in the [Admin Portal](https://admin.pubnub.com/) to store user data.
:::

### Method signature

This method takes the following parameters:

```kotlin
chat.getUser(userId: String): PNFuture<User?>
```

#### Input

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| userId | String | Yes |  | [Unique user identifier](https://www.pubnub.com/docs/general/setup/users-and-devices#user-id-usage) (up to 92 UTF-8 characters). |

#### Output

| Type | Description |
| --- | --- |
| `PNFuture<User?>` | `PNFuture` containing the user object with its metadata. |

### Sample code

Get details on user `support_agent_15`.

```kotlin
// reference the "chat" object and invoke the "getUser()" method
chat.getUser("support_agent_15").async { result ->
result.onSuccess {
        // handle success
    }.onFailure {
        // handle failure
    }
}
```

## Get current user

`currentUser` returns the current chat user.

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) in the [Admin Portal](https://admin.pubnub.com/) to store user data.
:::

### Sample code

Return the current chat user.

```kotlin
try {
    Result.success(chat.currentUser)
}.onSuccess { user ->
    user?.let {
        println("Current user is ${it.name} with ID ${it.id}")
    } ?: run {
        println("No current user in chat")
    }
}.onFailure { exception ->
    println("Failed to retrieve current user: ${exception.message}")
}
```