# Other

## Floating Button

The configuration for the floating button is done through the `useWidgetBtn` attribute on the `chat-component` component, which includes two mandatory parameters. The specific configuration is as follows:

1. `pos`: 'leftTop' | 'rightTop' | 'leftBottom' | 'rightBottom'; Used to control the relative position of the floating button with respect to the widget. Options include: top-left corner, top-right corner, bottom-left corner, bottom-right corner.
2. `left`: '100px'; `top`: '40px'; Default position of the floating button on the screen.
3. Parameters are separated by ';', as shown in the example below:

```javascript
<chat-component useWidgetBtn={'pos:rightBottom;top:800px;left:500px'} />
```

## Add event listeners to the widget

The widget supports event listeners, and when the corresponding events are triggered, the widget will proactively execute the callback functions associated with the listened events. Currently, there are three supported events:

1. `login`: Triggered when the user logs in. Callback function does not take any parameters.
2. `logout`: Triggered when the user logs out. Callback function does not take any parameters.
3. `unReadCount`: Triggered when the number of unread messages changes. Callback function takes the parameter `num`, which represents the number of unread messages.

| Method Name              | Description                       | Parameters                                                                                           | Return Values |
| ------------------------ | --------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------- |
| window\.chatWidgetApi.on | Add event listeners to the widget | <p>type: The type of events above, i.e., "login", "logout", etc. <br>callback: Callback function</p> | N/A           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sending-network.gitbook.io/sending.network/sdk-documentation/website-chat-widget-sdk/other.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
