Skip to main content
Version: 3.3.x

Environment Variables

Honeycomb uses environment variables to control the different configurations. Below we list the environment variables used by the app and indicate their properties via badges and text.

NameDesktop vs OnlineBuild vs Run-timeDefault ValueTypeDescription
REACT_APP_FIREBASEonlinebuildFalsebooleanIf the task is saving its data on Firebase.
REACT_APP_VIDEOdesktopbuildFalsebooleanIf the participant is being video recorded.
REACT_APP_USE_EEGdesktopbuildFalsebooleanIf the EEG (Event Marker) is available and recording.
REACT_APP_USE_PHOTODIODEdesktopbuildFalsebooleanIf the photodiode spot is in use.
REACT_APP_USE_VOLUMEdesktop onlinebuildFalsebooleanIf the participant should be asked to adjust their volume. (e.g. the task is using sound)
REACT_APP_STUDY_IDdesktop onlinerun""stringThe id of a study. User will enter this value in the login screen if not set.
REACT_APP_PARTICIPANT_IDdesktop onlinerun""stringThe id of a participant. User will enter this value in the login screen if not set.
EVENT_MARKER_PRODUCT_IDdesktoprun""stringThe product ID of the event marker. If not set, it will default to the productID set in public/config/trigger.js. If neither are set, it will attempt to connect using the COM name.
EVENT_MARKER_COM_NAMEdesktoprun"COM3"stringThe COM name of the event marker. If not set, it will use the comName set in public/config/trigger.js. Field is ignored if EVENT_MARKER_PRODUCT_ID is set.
note

Note that Honeycomb does use other environment variables (e.g., ELECTRON_START_URL) but they do not effect the task itself. They can be safely ignored.

Understanding the Environment Variables

Run-time

The run badge indicates the variable is set/determined each time the executable is run. Run-time environment variables allow for quick changes when running the task. They are convenient since they don't require building a whole different executable.

  • Desktop deployments must set these environment variables at the system level.
  • Online deployments must use Firebase, and store the runtime environment variables in Firestore.

Build-time

The build badge indicates the variable is set during the build phase (npm run build) and cannot be changed at run-time. These variables are configured via .env files in the env folder.

The dotenv-cli comes with the dotenv command that can be used to properly load the needed variables. We write our npm scripts with the following format:

package.json
"[build|dev]:<env name>": "dotenv -e env/<env name> npm run [build|dev]"

See NPM Scripts for more