> For the complete documentation index, see [llms.txt](/llms.txt).

# getUserInfo

Function to retrieve information about the connected user.

note

This function will only return information based on the connected adapter. These details are not stored anywhere and are fetched from the adapter during the connection and remain in the session.

info

For external wallet logins, this function returns no user details, only an empty `linkedAccounts`array (`{ linkedAccounts: [] }`). It only returns user details for social login embedded wallets.

### Usage

```javascript
// After successful login
const userInfo = await web3auth.getUserInfo()
console.log(userInfo)

```

### Return type

**Table**

| Property                  | Type    | Description                                                                                        |
| ------------------------- | ------- | -------------------------------------------------------------------------------------------------- |
| `email`                   | string  | Email of the user.                                                                                 |
| `name`                    | string  | Name of the user.                                                                                  |
| `profileImage`            | string  | Profile image of the user.                                                                         |
| `groupedAuthConnectionId` | string  | Grouped auth connection ID used for sign-in, if any.                                               |
| `authConnectionId`        | string  | Auth connection ID used for sign-in.                                                               |
| `userId`                  | string  | Unique user ID from the auth provider.                                                             |
| `authConnection`          | string  | Auth connection type used for sign-in (for example, `google`).                                     |
| `dappShare`               | string  | Dapp share of the user.                                                                            |
| `idToken`                 | string  | Token issued by Web3Auth.                                                                          |
| `oAuthIdToken`            | string  | Token issued by OAuth provider. Will be available only if you are using custom connections.        |
| `oAuthAccessToken`        | string  | Access token issued by OAuth provider. Will be available only if you are using custom connections. |
| `appState`                | string  | App state of the user.                                                                             |
| `touchIDPreference`       | string  | Touch ID preference of the user.                                                                   |
| `isMfaEnabled`            | boolean | Whether Multi Factor Authentication is enabled for the user.                                       |
| `linkedAccounts`          | array   | Accounts linked to the user, each a `LinkedAccountInfo` object.                                    |

**Type Declarations**

```typescript
getUserInfo(): Promise<Partial<UserInfo>>;

type UserInfo = AuthUserInfo & { linkedAccounts?: LinkedAccountInfo[] };

type AuthUserInfo = {
  email?: string;
  name?: string;
  profileImage?: string;
  groupedAuthConnectionId?: string;
  authConnectionId: string;
  userId: string;
  authConnection: AUTH_CONNECTION_TYPE | CUSTOM_AUTH_CONNECTION_TYPE;
  dappShare?: string;
  /**
   * Token issued by Web3Auth.
   */
  idToken?: string;
  /**
   * Token issued by OAuth provider. Will be available only if you are using
   * custom auth connection.
   */
  oAuthIdToken?: string;
  /**
   * Access Token issued by OAuth provider. Will be available only if you are using
   * custom auth connection.
   */
  oAuthAccessToken?: string;
  appState?: string;
  touchIDPreference?: string;
  isMfaEnabled?: boolean;
};

```

### Sample response

```json
{
  "email": "john@gmail.com",
  "name": "John Dash",
  "profileImage": "https://lh3.googleusercontent.com/a/Ajjjsdsmdjmnm...",
  "authConnectionId": "<your auth connection ID>",
  "userId": "john@gmail.com",
  "authConnection": "google",
  "dappShare": "<24 words seed phrase>", // will be sent only incase of custom connections
  "idToken": "<jwtToken issued by Web3Auth>",
  "oAuthIdToken": "<jwtToken issued by OAuth Provider>", // will be sent only incase of custom connections
  "oAuthAccessToken": "<accessToken issued by OAuth Provider>", // will be sent only incase of custom connections
  "linkedAccounts": []
}

```
