Skip to main content
Version: next

jsPsych and JATOS

JATOS basically cares for the server side: it stores result data, does worker management etc. JATOS doesn't care so much for what happens in the browser itself - your HTML, JavaScript and CSS. Of course you can write this all yourself, but you could also use a framework for this. A very good one is jsPsych.

In our example studies are a couple of jsPsych ones.

Here are the necessary changes if you want to adapt your jsPsych experiment so that it runs within (and sends the result data to) JATOS. Additionally you can have a look at Adapt Pre written Code to run it in JATOS.

Every jsPsych version works slightly different. Here we explain the steps for jsPsych 7 (for older versions have a look here).

How to turn your jsPsych 7 experiment into a JATOS study

  1. Include the jatos.js library in the <head> of your HTML

    <script src="jatos.js"></script>
  2. Tell jsPsych to send your result data to JATOS

    var jsPsych = initJsPsych({
    on_finish: () => jatos.endStudy(
  3. Wrap jsPsych's run in jatos.onLoad and if you want add a 'Cancel' button with jatos.addAbortButton.

    jatos.onLoad(() => {

That's all. Have a look at the 'Simple Reaction Time Task' in our example studies to see a full example with jsPsych 7.