> For the complete documentation index, see [llms.txt](https://xpansionchain-1.gitbook.io/xpansionchain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xpansionchain-1.gitbook.io/xpansionchain/products/passport/enable-user-identity/get-user-information.md).

# Get user information

## Get user information

This page instructs you how to get information about the user that is currently logged in.

#### Pre-requisites[​](https://docs.x.immutable.com/docs/x/passport/get-user-information#pre-requisites) <a href="#pre-requisites" id="pre-requisites"></a>

* The user must be <mark style="color:blue;">logged into</mark> your application via Passport

#### Getting user information[​](https://docs.x.immutable.com/docs/x/passport/get-user-information#getting-user-information) <a href="#getting-user-information" id="getting-user-information"></a>

The `getUserInfo` function on the Passport instance returns a promise that resolves with the following information about the currently logged-in user:

```
const userProfile = await passport.getUserInfo();
```

| Property                                                                         | Description                                                                                                           |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| email[1](https://docs.x.immutable.com/docs/x/passport/get-user-information#fn-1) | The email address of the logged-in user. This property will be undefined if the `email` scope has not been requested. |
| sub                                                                              | The subject (unique identifier) of the logged-in user.                                                                |
| nickname                                                                         | *This value will always be `undefined` for the time being.*                                                           |

Note that the `getUserInfo` function may throw the following error:

| Error Code             | Cause                                                  | Resolution                                                               |
| ---------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------ |
| NOT\_LOGGED\_IN\_ERROR | No user is logged in at the time of the function call. | Verify that a user has logged in before attempting to call `getUserInfo` |

<br>

[1](https://docs.x.immutable.com/docs/x/passport/get-user-information#fn-1) Apple Social Login Email Masking Restrictions: Partners implementing the Apple Social Login within Passport should note a potential restriction regarding the user's email address. If a user chooses to mask their email address, the email address return will appear as `xyz@privaterelay.appleid.com`. A masked email prevents partners from directly emailing users. Partners must consider this limitation while interacting with users who have enabled email masking through Apple Social Login. For any further inquiries or assistance, please get in touch with our dedicated support team.
