> For the complete documentation index, see [llms.txt](https://docs.frontnow.com/advise/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frontnow.com/advise/2/integration/events.md).

# Events

## init

This event gets triggered when the Frontnow Advisor is initialized.

```javascript
advisor.on("init", function () {
    console.log("Advisor initialized");
});
```

## open

This event gets triggered when the Frontnow Advisor is opened.

```javascript
advisor.on("open", function () {
    console.log("Advisor opened");
});
```

## close

This event gets triggered when the Frontnow Advisor is closed.

```javascript
advisor.on("close", function () {
    console.log("Advisor closed");
});     
```

## hideLauncher

This event gets triggered when the Frontnow Advisor is opened.

```javascript
advisor.on("hideLauncher", function () {
    console.log("Launcher hidden");
});
```

## showLauncher

This event gets triggered when the Frontnow Advisor is opened.

```javascript
advisor.on("showLauncher", function () {
    console.log("Launcher shown");
});
```

## pageChange

This event gets triggered when the page changes inside the Frontnow Advisor.

```javascript
advisor.on("pageChange", function () {
    console.log("Page changed");
});
```

## prompt

This event gets triggered when the user entered a new question.

<pre class="language-javascript"><code class="lang-javascript"><strong>advisor.on("prompt", function () {
</strong>    console.log("New user input");
});
</code></pre>

## suggestionClick

This event gets triggered when suggested question is clicked on the start page.

<pre class="language-javascript"><code class="lang-javascript"><strong>advisor.on("suggestionClick", function () {
</strong>    console.log("Suggestion clicked");
});
</code></pre>

## click

This event gets triggered when a document is clicked in the recommendation carousel.

<pre class="language-javascript"><code class="lang-javascript"><strong>advisor.on("click", function () {
</strong>    console.log("Document clicked");
});
</code></pre>

These events provide developers with flexibility to handle any events inside the Frontnow Advisor.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.frontnow.com/advise/2/integration/events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
