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.
Name | Desktop vs Online | Build vs Run-time | Default Value | Type | Description |
---|---|---|---|---|---|
REACT_APP_FIREBASE | False | If the task is saving its data on Firebase. | |||
REACT_APP_VIDEO | False | If the participant is being video recorded. | |||
REACT_APP_USE_EEG | False | If the EEG (Event Marker) is available and recording. | |||
REACT_APP_USE_PHOTODIODE | False | If the photodiode spot is in use. | |||
REACT_APP_USE_VOLUME | False | If the participant should be asked to adjust their volume. (e.g. the task is using sound) | |||
REACT_APP_STUDY_ID | "" | The id of a study. User will enter this value in the login screen if not set. | |||
REACT_APP_PARTICIPANT_ID | "" | The id of a participant. User will enter this value in the login screen if not set. | |||
EVENT_MARKER_PRODUCT_ID | "" | The 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_NAME | "COM3" | The 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 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 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 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:
"[build|dev]:<env name>": "dotenv -e env/<env name> npm run [build|dev]"
See NPM Scripts for more