diff --git a/docs/overview/experiment-options.md b/docs/overview/experiment-options.md index 81ff7d09..17748370 100644 --- a/docs/overview/experiment-options.md +++ b/docs/overview/experiment-options.md @@ -118,4 +118,17 @@ jsPsych.init({ timeline: [...], override_safe_mode: true }); +``` + +## Add extensions + +Extensions are jsPsych modules that can run throughout the experiment and interface with any plugin to extend the functionality of the plugin. One example of an extension is eye tracking, which allows you to gather gaze data during any trial and add it to that trial's data object. If you want to use extensions in your experiment, you must specify this when you initialize the experiment with `jsPsych.init`. The `extensions` parameter in `jsPsych.init` is an array of objects, where each object specifies the extension that you'd like to use in the experiment. Below is an example of adding the webgazer extension. + +```js +jsPsych.init({ + timeline: [...], + extensions: [ + {type: 'webgazer'} + ] +}); ``` \ No newline at end of file