Configuration
Environment Variables
Honeycomb uses environment variables during build and run time to control the different configurations. Below we list the environment variables used by the app and indicate whether they are mandatory, optional and needed during build (npm build
) or run time (using the application executable or npm run dev
)
ELECTRON_START_URL
: URL (e.g.http://localhost:3000
) where the front end of the app is being hosted - also used inelectron.js
to indicate the app is running in dev mode.EVENT_MARKER_PRODUCT_ID
: The product ID of the event marker (e.g.0487
). If not set, it will use theproductID
set inpublic/config/trigger.js
if available, or attempt to connect using the com name.EVENT_MARKER_COM_NAME
: The com name of the event marker (e.g.COM3
). If not set, it will use thecomName
set inpublic/config/trigger.js
. If theproductID
is set (not an empty string), this field will be ignored.REACT_APP_VOLUME
: whether the participant is being asked to adjust volume. This can be used on both the desktop (electron) and online settings.REACT_APP_VIDEO
: whether the participant is being video recorded. This can be used when the task is running as a desktop app (electron).REACT_APP_USE_EEG
: whether the event marker/EEG is available. This can be used when the task is running as a desktop app (electron).REACT_APP_USE_PHOTODIODE
: whether the photodiode is in use. This can be used when the task is running as a desktop app (electron).REACT_APP_PARTICIPANT_ID
: The default participant id to show when authorizing a participant. If not set, user will need to enter the value in the provided input box.REACT_APP_STUDY_ID
: The default study id to show when authorizing a participant. If not set, user will need to enter the value in the provided input box.
Here are details on some of the badges:
-
: Run-time environment variable. Set at the system level. See this tutorial for OS specific instructions.
-
: Build-time environment variable. Set in a
.env
file before building. Can also be defined in a separate file under theenv/
directory and called with the dotenv-cli before building. NOTE: Thedotenv
command will not work directly from the command line. Instead, to set build-time environment variables, either run an existing npm script (e.g.,npm run build:clinic
, which sets clinic variables) or add a new script topackage.json
with the following format:
"[build|dev]:<script name>": "dotenv -e env/<your env file> npm run [build|dev]"
Or, to add your new variables to an existing environment configuration, e.g. .env.clinic
, create a script in the following format:
"[build|dev]:<script name>": "dotenv -e env/<your env file> npm run [build|dev]:clinic"
Then run the script like so: npm run [build|dev]:<script name>
.