---
source_url: https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/users/details
title: Manage user details
updated_at: 2026-06-19T11:35:23.361Z
---

> 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

```csharp
chat.GetUser(
    string userId
)
```

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

The method returns an awaitable `Task<ChatOperationResult<User>>` with the `User` object if it exists, otherwise the `Error` property on the result will be true.

#### Sample code

Get details on user `support_agent_15`.

```csharp
using System.Threading.Tasks;
using PubnubApi;
using PubnubChatApi;
using UnityEngine;

// Configuration
PubnubChatConfig chatConfig = new PubnubChatConfig();
        
PNConfiguration pnConfiguration = new PNConfiguration(new UserId("myUniqueUserId"))
{
    SubscribeKey = "demo",
    PublishKey = "demo",
    Secure = true
};

// Initialize Unity Chat
var chatResult = await UnityChat.CreateInstance(chatConfig, pnConfiguration);
if (!chatResult.Error)
{
    chat = chatResult.Result;
}
var result = await chat.GetUser("support_agent_15");
if (!result.Error)
{
    var user = result.Result;
    Debug.Log($"Found user with name {user.UserName}");
}
```

## Get current user

`GetCurrentUser()` 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

```csharp
chat.GetCurrentUser()
```

#### Input

This method doesn't take any parameters.

#### Output

The method returns an awaitable `Task<ChatOperationResult<User>>` with the found `User` object.

#### Sample code

Return the current chat user.

```csharp
using System.Threading.Tasks;
using PubnubApi;
using PubnubChatApi;
using UnityEngine;

// Configuration
PubnubChatConfig chatConfig = new PubnubChatConfig();
        
PNConfiguration pnConfiguration = new PNConfiguration(new UserId("myUniqueUserId"))
{
    SubscribeKey = "demo",
    PublishKey = "demo",
    Secure = true
};

// Initialize Unity Chat
var chatResult = await UnityChat.CreateInstance(chatConfig, pnConfiguration);
if (!chatResult.Error)
{
    chat = chatResult.Result;
}
var result = await chat.GetCurrentUser();
if (!result.Error)
{
    var user = result.Result;
    Debug.Log($"Current user is {user.UserName}");
            
    // perform additional actions with the user if needed
}
else
{
    Debug.Log("Current user not found.");
}
```