> For the complete documentation index, see [llms.txt](https://help.pickzen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pickzen.com/developers/api/hooks.md).

# Hooks

Hooks allow executing custom JavaScript functions upon interacting with slides. For example, calling a third-party tracking endpoint when the next button of a form slide is clicked. Each slide-type defines different hook types that can be configured on each slide JavaScript section:

![](/files/-M5CS7Mn66h6G9owoM6x)

In order to define a hook on a slide, we need to define the hook type and a callback function. The callback function includes two parameters: a *done* function and an optional *data* parameter. The *done* function has to be called after the custom code has been executed, otherwise, the default flow will be interrupted. The *data* parameter contains contextual information related to the hook. The extension parameter is an internal parameter needed to define the hook.

### Hook types

* **Question slide**
  * **onSelect**: Executed when an option is clicked. The data parameter contains the index of the selected option.
  * **onSkip**: Executed when the Skip button is clicked.
  * **onNext**: Executed when the Next button is clicked.
* **Form slide**
  * **onSend**: Executed when the Next button is clicked.
  * **onSkip**: Execute when the Skip button is clicked.

####
