> 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/other.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
