# 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](https://docs.mluvii.com/en/for-it-specialists/customization/parameters). 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](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/routing) and evaluating the [rules](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/rules) 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](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/routing) is determined.

`$owidget.getOperatorStatus();`

## hideCTA

Suitable for hiding the previously displayed [pop-up](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/webchat#pop-up).

`$owidget.hideCTA();`

## init

It is used to initialize the script on the page. Coincidentally, this is part of the [WebChat script](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/webchat), 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*](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/webchat)*.*
{% 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");`
