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.