# Events

`zapieteats:init`\
Fired when the widget initializes.

```
 window.ZapietEvent.listen('zapieteats:init', function() {
    console.log('Widget initialized');
 });
```

\
​`zapieteats:ready`

Fired when the widget is ready.

```
window.ZapietEvent.listen('zapieteats:ready', function() {
  console.log('Widget ready');
});
```

\
​`zapieteats:settings:loading`\
Fired when settings are loading.

```
window.ZapietEvent.listen('zapieteats:settings:loading', function() {
  console.log('Settings loading');
});
```

`zapieteats:settings:loaded`\
Fired when settings are loaded.

```
window.ZapietEvent.listen('zapieteats:settings:loaded', function(settings) {
  console.log('Settings loaded', settings);
});
```

`zapieteats:restaurants:loading`

Fired when restaurants are loading.

```
window.ZapietEvent.listen('zapieteats:restaurants:loading', function() {
  console.log('Restaurants loading');
});
```

`zapieteats:restaurants:loaded`

Fired when restaurants are loaded.

```
window.ZapietEvent.listen('zapieteats:restaurants:loaded', function(restaurants) {
  console.log('Restaurants loaded', restaurants);
});
```

\
​`zapieteats:language:changed`\
Fired when the language changes.

```
window.ZapietEvent.listen('zapieteats:language:changed', function(language) {
  console.log('Language changed to', language);
});
```

`zapieteats:restaurant:changed`\
Fired when the selected restaurant changes.

```
window.ZapietEvent.listen('zapieteats:restaurant:changed', function(restaurant) {
  console.log('Restaurant changed', restaurant);
});
```

`zapieteats:menu:changed`

Fired when the selected menu changes.

```
window.ZapietEvent.listen('zapieteats:menu:changed', function(menu) {
  console.log('Menu changed', menu);
});
```

`zapieteats:deliveryoption:changed`

Fired when the delivery option changes.

```
window.ZapietEvent.listen('zapieteats:deliveryoption:changed', function() {
  console.log('Delivery option changed');
});
```

`zapieteats:modal:opened`

Fired when the modal is opened.

```
window.ZapietEvent.listen('zapieteats:modal:opened', function() {
  console.log('Modal opened');
});
```

`zapieteats:modal:closed`

Fired when the modal is closed.

```
window.ZapietEvent.listen('zapieteats:modal:closed', function() {
  console.log('Modal closed');
});
```


---

# 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.zapiet.com/zapiet-eats/reference/events.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.
