---
source_url: https://www.pubnub.com/docs/chat/swift-chat-sdk/build/features/users/details
title: Manage user details
updated_at: 2026-06-17T11:37:17.761Z
---

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

```swift
chat.getUser(
    userId: String
) async throws -> UserImpl?
```

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

| Parameter | Description |
| --- | --- |
| `UserImpl` | Returned object containing the user metadata. |

### Sample code

:::tip Sample code
The code samples in Swift Chat SDK focus on asynchronous code execution.
You can also write synchronous code as the parameters are shared between the async and sync methods but we don't provide usage examples of such.
:::

Get details on user `support_agent_15`.

```swift
// Assumes a "ChatImpl" reference named "chat"
Task {
  if let user = try await chat.getUser(userId: "support_agent_15") {
    debugPrint("Fetched user metadata with ID: \(user.id)")
  } else {
    debugPrint("User not found")
  }
}
```

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

:::tip Sample code
The code samples in Swift Chat SDK focus on asynchronous code execution.
You can also write synchronous code as the parameters are shared between the async and sync methods but we don't provide usage examples of such.
:::

Return the current chat user.

```swift
// Assumes a "ChatImpl" reference named "chat"
// Access the "currentUser" property to get details of the current chat user
let currentUser = chat.currentUser
```