# Supported widget methods

**Supported methods:**

1. [addCustomData](#addcustomdata)
2. [clearCustomData](#clearcustomdata)
3. [openChat](#openchat)
4. [closeChat](#closechat)
5. [connectToServer](#connecttoserver)
6. [getAVSupport](#getavsupport)
7. [getOperatorStatus](#getoperatorstatus)
8. [hideCTA](#hidecta)
9. [removeCustomData](#removecustomdata)

{% hint style="danger" %}
*If you use multiple instances of webchat on your site, you must always place an **unambiguous identification of each instance** before the method name: **instances()\[x]**, where X is the instance name (0 - 9)*&#x20;

***For example,*** *`$owidgets.instances()[1].addCustomData("contract", "test123");`*
{% endhint %}

## addCustomData

The method is used to pass values from the web that are stored in existing [parameters](/en/for-it-specialists/customization/parameters.md). These parameters can be made available to operators so that they can see them for each received session.

`$owidget.addCustomData('smlouva', 'test123');`

## clearCustomData

The method is suitable for the opposite situation (when you need to delete the currently stored value from a variable.

`$owidget.clearCustomData();`

## openChat

It's used for chat window opening.

`$owidget.openChat();`

## closeChat

It's used for chat window closing.

`$owidget.closeChat();`

## connectToServer

Used to load the current widget configuration. If a more current configuration is found on the server, it will replace the current one. It also initializes the widget, including discovering the state of the groups contained in the [routing](/en/for-administrators/tenant-management/settings/routing.md) and evaluating the [rules](/en/for-administrators/tenant-management/settings/rules.md) set.

`$owidget.connectToServer();`

## getAVSupport

The method is used to determine whether the client side is ready for an Audio/Video session.

`$owidget.getAVSupport();`

## getOperatorStatus

The state of the operators (groups) contained in the [routing](/en/for-administrators/tenant-management/settings/routing.md) is determined.

`$owidget.getOperatorStatus();`

## hideCTA

Suitable for hiding the previously displayed [pop-up](/en/for-administrators/tenant-management/settings/webchat.md#pop-up).

`$owidget.hideCTA();`

## init

It is used to initialize the script on the page. Coincidentally, this is part of the [WebChat script](/en/for-administrators/tenant-management/settings/webchat.md), where it is always necessary to specify the CompanyGUID and the name of the WebChat script.

{% hint style="info" %}
*Be sure to include the CompanyGUID, which can be found in the* [*WebChat script*](/en/for-administrators/tenant-management/settings/webchat.md)*.*
{% endhint %}

`$owidget.init("CompanyGUID", "Widget Name");`

## removeCustomData

It is the opposite method to addCustomData and is used to delete the value of the variable.

`$owidget.removeCustomData("smlouva", "test123");`


---

# 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://docs.mluvii.com/en/for-it-specialists/supported-widget-methods.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.
