Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/new-multiplayer-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This package lets you start building a [jsPsych multiplayer adapter](https://github.com/jspsych/jsPsych/blob/main/docs/developers/adapter-development.md) by simply running `npx @jspsych/new-multiplayer-adapter` from the command line.

A multiplayer adapter implements jsPsych's `MultiplayerAdapter` interface and is responsible for the network I/O against a specific backend (JATOS group sessions, Firebase, a custom WebSocket server, etc.). Once written, it can be passed to `jsPsych.pluginAPI.connect()` and used by any multiplayer plugin.
A multiplayer adapter implements jsPsych's `MultiplayerAdapter` interface and is responsible for the network I/O against a specific backend (JATOS group sessions, Firebase, a custom WebSocket server, etc.). Once written, it can be passed to `jsPsych.multiplayer.connect()` and used by any multiplayer plugin.

You will be prompted to enter a name for your adapter, a description, the name of the author, an optional link to the author's GitHub profile, and an optional link to a `README.md` file. A template package containing boilerplate TypeScript code will then be generated in your current working directory.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{description}

This is a [jsPsych multiplayer adapter](https://github.com/jspsych/jsPsych/blob/main/docs/developers/adapter-development.md). It implements the `MultiplayerAdapter` interface so it can be passed to `jsPsych.pluginAPI.connect()` and used by multiplayer plugins.
This is a [jsPsych multiplayer adapter](https://github.com/jspsych/jsPsych/blob/main/docs/developers/adapter-development.md). It implements the `MultiplayerAdapter` interface so it can be passed to `jsPsych.multiplayer.connect()` and used by multiplayer plugins.

## Loading

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {globalName} from "{npmPackageName}";
const jsPsych = initJsPsych();

// Connect the adapter before running the timeline.
await jsPsych.pluginAPI.connect(new {globalName}(/* backend-specific options */));
await jsPsych.multiplayer.connect(new {globalName}(/* backend-specific options */));

await jsPsych.run(timeline);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
async function run() {
// Connect the adapter before running the timeline. Pass any backend-specific
// options your adapter's constructor needs.
await jsPsych.pluginAPI.connect(new {globalName}());
await jsPsych.multiplayer.connect(new {globalName}());

const trial = {
type: jsPsychMultiplayerSync,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { GroupSessionData, MultiplayerAdapter, Unsubscribe } from "jspsych";
* {description}
*
* A jsPsych multiplayer adapter implements the `MultiplayerAdapter` interface so it can be passed
* to `jsPsych.pluginAPI.connect(new {camelCaseName}Adapter(...))`. The adapter is responsible only
* to `jsPsych.multiplayer.connect(new {camelCaseName}Adapter(...))`. The adapter is responsible only
* for network I/O against a specific backend; all higher-level behavior (subscribe replay,
* `wait()` fast-path, subscription tracking) lives in jsPsych's `MultiplayerAPI`, so it stays
* consistent across backends.
Expand Down