> For the complete documentation index, see [llms.txt](https://sending-network.gitbook.io/sending.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sending-network.gitbook.io/sending.network/sdk-documentation/website-chat-widget-sdk/room.md).

# Room

## Create public room

```javascript
window.chatWidgetApi.createPublicRoom(roomName).then((roomID)=>{console.log(roomID)})
```

<table><thead><tr><th width="220">Method Name</th><th>Description</th><th>Parameters</th><th>Return Values</th></tr></thead><tbody><tr><td>window.chatWidgetApi.createPublicRoom</td><td>Create a public group chat with the roomName</td><td>roomName</td><td>roomIDa</td></tr></tbody></table>

## Create private room

```javascript
window.chatWidgetApi.createPrivateRoom(roomName).then((roomID)=>{console.log(roomID)})
```

<table><thead><tr><th width="227">Method Name</th><th>Description</th><th>Parameters</th><th>Return Values</th></tr></thead><tbody><tr><td>window.chatWidgetApi.createPrivateRoom</td><td>Create a private group chat with the roomName</td><td>roomName</td><td>roomID</td></tr></tbody></table>

## **Create DM**

```javascript
window.chatWidgetApi.createDMRoom(userId).then((roomId)=>{console.log(roomId)})
```

| Method Name                        | Description                   | Parameters | Return Values |
| ---------------------------------- | ----------------------------- | ---------- | ------------- |
| window\.chatWidgetApi.createDMRoom | Invite user to a private chat | userId     | roomId        |

## Join a chat room

```javascript
window.chatWidgetApi.joinRoom(roomID)
```

<table><thead><tr><th width="227">Method Name</th><th>Description</th><th>Parameters</th><th>Return Values</th></tr></thead><tbody><tr><td>window.chatWidgetApi.joinRoom</td><td>Join a chat room corresponding to the roomid</td><td>roomID</td><td>N/A</td></tr></tbody></table>

## Invite user to a chat

```javascript
window.chatWidgetApi.invite(roomID, userID)
```

<table><thead><tr><th width="227">Method Name</th><th>Description</th><th>Parameters</th><th>Return Values</th></tr></thead><tbody><tr><td>window.chatWidgetApi.invite</td><td>Invite user to a group chat</td><td><ol><li>roomID</li><li>userID</li></ol></td><td>N/A</td></tr></tbody></table>
