# On

LiSA Library and its components emit events that can be caught and acted upon.

### error

Any error the LiSA library throws and/or catches during its life cycle is exposed via the Library error event callback. You can register a callback function which receives the Error instance as its single argument.

```
window.LiSA.library.configs.push({
  on: {
    error: (err) => {
      console.error(err);
    }
  },
});
```

### ready

You can provide a LiSA Library event handler in order to customize the behavior of your LiSA player.

```
window.LiSA.library.configs.push({
  on: {
    ready: (library) => {
      library.player.on(library.player.Event.PLAYER_READY, () => {
        console.log('LiSA Library is ready!');
      })
    }
  },
});
```

**Please note:** The Library object, the Library's player and its exposed APIs are only accessible within the Library ready callback function.

Please see Player API reference for further information on how to customize the behaviour of your player.


---

# 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.hello-lisa.com/developers/widgets/configuration-options/on.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.
