# Methods

{% hint style="info" %}
Before using these methods, ensure that the Frontnow Advisor has been properly initialized. For setup instructions, please refer to the [Getting Started](/advise/introduction/getting-started.md) page.
{% endhint %}

### `isReady()`

Checks if the Frontnow Advisor is ready.

**Returns:**

* `boolean` - `true` if the advisor is ready, otherwise `false`.

**Example usage:**

```javascript
if (advisor.isReady()) {
    console.log('Advisor is ready!');
}
```

### `open()`

Opens the Frontnow Advisor widget.

**Example usage:**

```javascript
advisor.open();
```

### `close()`

Closes the Frontnow Advisor widget.

**Example usage:**

```javascript
advisor.close();
```

### `showEoC()`

Opens the Frontnow "End of Conversation" widget.

**Example usage:**

```javascript
advisor.showEoC();
```

### `closeEoC()`

Closes the Frontnow "End of Conversation" widget.

**Example usage:**

```javascript
advisor.closeEoC();
```

### `showLauncher()`

Shows the Frontnow Advisor launcher button.

**Example usage:**

```javascript
advisor.showLauncher();
```

### `hideLauncher()`

Hides the Frontnow Advisor launcher button.

**Example usage:**

```javascript
advisor.hideLauncher();
```

### `sendMessage(message)`

Sends a message to the Frontnow Advisor.

**Parameters:**

* `message` (`string`) - The message to send to the advisor.

**Example usage:**

```javascript
advisor.sendMessage('How can I find the best city bike?');
```

### `stopMessage()`

Stops the current message loading in the Frontnow Advisor.

**Example usage:**

```javascript
advisor.stopMessage();
```

### `updateTargetElement(`newTargetElement`)`

Updates the target element for the Frontnow Advisor. This method is only applicable when using custom targeting.

**Parameters:**

* `newTargetElement` (`HTMLElement`): The new HTML element to target.

**Disclaimer:**

This method should only be used if you are implementing custom targeting for the Frontnow Advisor. Ensure that the `newTargetElement` parameter is a valid HTML element.

**Example usage:**

```javascript
const newTarget = document.getElementById('custom-target');
if (newTarget) {
    advisor.updateTargetElement(newTarget);
}
```

**Notes:**

* The current advisor instance will close before updating the target element.
* The `advisorContainer` will be removed and reinitialized to target the new element.

### `openNewChat()`

Opens a new chat in the Frontnow Advisor.

**Example usage:**

```javascript
advisor.openNewChat();
```


---

# 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.frontnow.com/advise/integration/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.
