# Methods

Through JS API you can manage Quickley Live Chat windows behavior. Methods can be called by using global object `Quickley` that  available anywhere after the widget code.&#x20;

Global object `Quickley` accepts two arguments. The first is the method name. The second is the parameters of callable method.

```markup
<!-- Quickley.Chat -->
...
<!-- /Quickley.Chat -->

Quickley('sendAutoMessage', 'Hello! Can i help you?');
```

## `show`

Displays Quickley Chat button if it was previously hidden by configuration param `hidden`.

```markup
<script>
	window.QCHAT_CFG = {
  	hidden: true
	}
</script>

<!-- Quickley.Chat -->
...
<!-- /Quickley.Chat -->

setTimeout(() => {
	Quickley('show');
}, 1000);
```

## `hide`

Hides Quickley Chat button if it visible.

```markup
<!-- Quickley.Chat -->
...
<!-- /Quickley.Chat -->

Quickley('hide');
```

## `open`

Opens Quickley Chat Window. Calling of this method is similar to clicking Quickley Chat button.

```markup
<!-- Quickley.Chat -->
...
<!-- /Quickley.Chat -->

Quickley('open');
```

## `close`

Closes the Quickley Сhat window. Calling this method is similar to clicking the Quickley Chat button while the Сhat window is open.

```markup
<!-- Quickley.Chat -->
...
<!-- /Quickley.Chat -->

Quickley('close');
```

## `sendAutoMessage`

Sends message to a visitor. This method works only if a visitor doesn't have any active conversation.

```markup
<!-- Quickley.Chat -->
...
<!-- /Quickley.Chat -->

Quickley('sendAutoMessage', 'Hello! Can i help you?');
```

## `updateClientData`

Specifies any information about visitors like email, phone or any kind of data. This info displays in the right panel in Quickley. This method is similar to the `client_data` parameter in the Quickley Chat configuration, but can be used at any time after Chat is initialized.

```markup
<!-- Quickley.Chat -->
...
<!-- /Quickley.Chat -->

Quickley('updateClientData', {
  name: "John Dorian"
	email: "jd@thescrubs.com",
  "Any kind of information's title": "Any kind of information's value"
});
```


---

# 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://developers.quickley.com/chat-api/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.
