A practical tutorial for implementing fMRI experiments with jsPsych

Abstract jsPsych is widely used for online behavioral experiments but also supports offline laboratory use, opening possibilities for neurophysiological research. However, the practical value of these applications has received far less attention. This tutorial uses functional magnetic resonance imaging (fMRI) to show how existing jsPsych-based experiments can be adapted for scanner-based use. We review the current landscape of behavioral experiment software and highlight an overlooked methodological application of jsPsych in fMRI research. Because supported browsers are often already installed, jsPsych typically requires no additional software installation or separate runtime configuration, limiting setup-related problems. We outline how jsPsych can handle three core technical requirements of fMRI experiments: synchronization with scanner acquisition, response collection through scanner-compatible input devices, and temporal control over stimulus presentation and event logging. On this basis, we provide a step-by-step implementation guide for researchers new to jsPsych and those adapting existing jsPsych experiments for fMRI. Starting with local setup, the guide uses configurable code to demonstrate scanner trigger integration and temporal alignment, button-box responses using native multiple-choice and adapted continuous-slider formats, and structured data saving (code available at https://osf.io/z2xmh/). We further discuss practical considerations, including workflow organization, data management, hardware setup, and compatibility testing prior to formal data collection. More broadly, using jsPsych may simplify cross-site deployment and maintain task consistency across research stages, providing a shared basis for multimodal data integration. From an open-science perspective, it may also enhance portability, transparency, and reproducibility.

Authors

Institutions

Publication Details

Journal
Behavior Research Methods
Published
2026-11-30
DOI
https://doi.org/10.3758/s13428-026-03245-0
Primary Topic
Neural and Behavioral Psychology Studies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

A practical tutorial for implementing fMRI experiments with jsPsych

Gabriela Rosenblau, Josué García‐Arch, Xiong Hu, Yen-Wen Chen et al.
Behavior Research Methods
Neural and Behavioral Psychology Studies
article

A practical tutorial for implementing fMRI experiments with jsPsych

Gabriela Rosenblau, Josué García‐Arch, Xiong Hu, Yen-Wen Chen, Christoph Korn
article en

Abstract

Abstract jsPsych is widely used for online behavioral experiments but also supports offline laboratory use, opening possibilities for neurophysiological research. However, the practical value of these applications has received far less attention. This tutorial uses functional magnetic resonance imaging (fMRI) to show how existing jsPsych-based experiments can be adapted for scanner-based use. We review the current landscape of behavioral experiment software and highlight an overlooked methodological application of jsPsych in fMRI research. Because supported browsers are often already installed, jsPsych typically requires no additional software installation or separate runtime configuration, limiting setup-related problems. We outline how jsPsych can handle three core technical requirements of fMRI experiments: synchronization with scanner acquisition, response collection through scanner-compatible input devices, and temporal control over stimulus presentation and event logging. On this basis, we provide a step-by-step implementation guide for researchers new to jsPsych and those adapting existing jsPsych experiments for fMRI. Starting with local setup, the guide uses configurable code to demonstrate scanner trigger integration and temporal alignment, button-box responses using native multiple-choice and adapted continuous-slider formats, and structured data saving (code available at https://osf.io/z2xmh/). We further discuss practical considerations, including workflow organization, data management, hardware setup, and compatibility testing prior to formal data collection. More broadly, using jsPsych may simplify cross-site deployment and maintain task consistency across research stages, providing a shared basis for multimodal data integration. From an open-science perspective, it may also enhance portability, transparency, and reproducibility.

Behavior Research MethodsVol. 59(1)
George Washington University (US), Heidelberg University (DE), NeuroDevelopment Center (US), Center for Autism and Related Disorders (US)
Neural and Behavioral Psychology Studies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon