# 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](https://docs.frontnow.com/advise/4/introduction/getting-started) 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();
```
