---
description: JavaScript Widget User API
---

# User

## Get user ID

```javascript
window.chatWidgetApi.getUserId()
```

| Method Name                    | Description     | Parameters | Return Values |
| ------------------------------ | --------------- | ---------- | ------------- |
| window.chatWidgetApi.getUserId | Get the user id | N/A        | userID        |

## **Get User ID from wallet address**

```javascript
window.chatWidgetApi.getUidByAddress(address).then((userId)=>{console.log(userId)})
```

| Method Name                          | Description                   | Parameters     | Return Values |
| ------------------------------------ | ----------------------------- | -------------- | ------------- |
| window.chatWidgetApi.getUidByAddress | Get user ID by wallet address | wallet address | userId        |

## **Get user information**

| Method Name                      | Description          | Parameters | Return Values                                                   |
| -------------------------------- | -------------------- | ---------- | --------------------------------------------------------------- |
| window.chatWidgetApi.getUserData | Get user information | N/A        | User info: avatar\_url, displayname, signature, wallet\_address |

## Log Out

| Method Name                 | Description                    | Parameters                                      | Return Values |
| --------------------------- | ------------------------------ | ----------------------------------------------- | ------------- |
| window.chatWidgetApi.logout | Log out of the current session | callback (optional): Callback after logging out | N/A           |
