---
source_url: https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/details
title: Manage user details
updated_at: 2026-09-30T07:20:08.000Z
---

# Manage user details

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

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

##### Under the hood

`getUser()` calls App Context API and the JavaScript SDK [getUUIDMetadata()](https://www.pubnub.com/docs/sdks/javascript/api-reference/objects.md#get-user-metadata) method.

This method takes the following parameters:

```ts
chat.getUser(
    id: string
): Promise<User | null>
```

#### Input

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| id | string | Yes |  | [Unique user identifier](https://www.pubnub.com/docs/architecture/core-concepts.md) (up to 92 UTF-8 characters). |

#### Output

| Type | Description |
| --- | --- |
| `Promise<User>` or `Promise<null>` | Returned object containing the user metadata or a null value if the user doesn't exist. |

#### Errors

If you try to fetch a user without providing their ID, you will receive the `ID is required` error.

### Sample code

Get details on user `support_agent_15`.

```ts
// reference the "chat" object and invoke the "getUser()" method
const user = await chat.getUser("support_agent_15")
```

## 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.
:::

### Method signature

This method has the following signature:

```ts
chat.currentUser: User
```

#### Properties

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| currentUser | User | Optional |  | Returned [User object](https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/user.md). |

### Sample code

Return the current chat user.

```ts
chat.currentUser
```

Last updated at: 2026-09-30T07:20:08.000Z
