---
title: "Open the widget from your page"
description: "Open, close or prefill the chat bubble from your own buttons with the small JavaScript API the widget script exposes."
canonical: "https://lookio.app/docs/widget/javascript-api"
updated: "2026-10-17"
---

# Open the widget from your page

Once the widget script is on the page, it exposes `window.Lookio`:

```js
Lookio.open();     // opens the chat
Lookio.close();
Lookio.toggle();
Lookio.ask("How do returns work?"); // opens the chat and asks
```

For example, a help button of your own:

```html
<button onclick="Lookio.open()">Ask our assistant</button>
```

The page receives `lookio:open` and `lookio:close` events on `window`:

```js
window.addEventListener("lookio:open", () => console.log("chat opened"));
```

The API drives the bubble. An in-page chat is always open.
