Skip to content
ajit283 edited this page Dec 13, 2023 · 7 revisions

Webpsy.js Wiki

🌐 WebPsy.js 🧠

Free to use online library for programming of psychological online experiments - the JavaScript library tailored to elevate your psychological studies in the digital realm! 🚀 From academics, for academics.

Whether you're a curious psychologist, a dedicated researcher, or a tech-savvy cognitive scientist, WebPsy.js is your indispensable toolkit for designing and conducting seamless web-based psychological experiments, with a particular focus on harnessing the power of jsPsych.

Contributions and Feedback

Contributions and feedback are welcome; have a look at CONTRIBUTING.md for more information.

How to use

First, create an experiment. The best way to do this is to clone the coglabuzh/jspsych-template repository, as it provides a good starting point. Remember to run npm i in the root of the experiment to install the necessary dependencies. Then, run npm i @coglabuzh/webpsy.js to install the production version of this library. Now, you can import the functions and types described below by including this at the top of any .ts/.js file:

import { colorPicker, coloredGraphic } from "@coglabuzh/webpsy.js";

Examples

The /examples folder contains example experiments that use the library functions and act as a starting point to develop your own experiments. Here's how to use them to create your own experiment:

  1. On the GitHub website, navigate to the folder that contains the experiment.
  2. Copy the contents of the address bar to copy the current url. (Example: https://github.com/coglabuzh/online-exps/tree/main/examples/wm-ltm-test)
  3. Go to DownGit and paste the url there. Click "Download".
  4. The experiment is now downloaded as a ZIP file. Unpack it, then open it in your editor.
  5. Run npm install and then npm run dev to install all necessary dependencies and run the experiment in your browser.

Structure

Currently, the library is comprised of three categories:

These are functions that return HTML as a string. They can be used in any jsPsych trial that has a stimulus field.

These are functions that are needed frequently when creating experiments.

Adds some much-needed types to jsPsych. Currently, we mostly provide types for the data generated by trials.

There are examples that show you how to implement functions for specific experiments.