Skip to main content

Configuration

The Member Portal reads all its configuration from environment variables at build time. These are defined in a .env file inside the memberportal/ folder.

File: memberportal/src/config.ts

Environment Variables​

Create a .env file at memberportal/.env with the following variables:

VITE_MEDPLUM_BASE_URL=http://localhost:8103/
VITE_MEDPLUM_PROJECT_ID=your-project-id
VITE_MEDPLUM_CLIENT_APP_ID=your-client-app-id
VITE_MEDPLUM_GOOGLE_CLIENT_ID=your-google-client-id
VITE_RECAPTCHA_SITE_KEY=your-recaptcha-site-key
VITE_MICROSOFT_CLIENT_ID=your-microsoft-client-id
VITE_MICROSOFT_TENANT_ID=your-microsoft-tenant-id

Variable Reference​

VariableRequiredDescription
VITE_MEDPLUM_BASE_URLYesURL of the ChartChat server API. Use http://localhost:8103/ for local dev.
VITE_MEDPLUM_PROJECT_IDYesThe Medplum project ID this portal belongs to. Found in the Admin Portal under project settings.
VITE_MEDPLUM_CLIENT_APP_IDYesThe Medplum client application ID used for OAuth. Created in the Admin Portal.
VITE_MEDPLUM_GOOGLE_CLIENT_IDNoGoogle OAuth 2.0 client ID. Required only if Google Sign-In is enabled.
VITE_RECAPTCHA_SITE_KEYNoGoogle reCAPTCHA v2 site key. Required for the password reset form in Settings.
VITE_MICROSOFT_CLIENT_IDNoAzure AD application (client) ID. Required only if Microsoft SSO is enabled.
VITE_MICROSOFT_TENANT_IDNoAzure AD tenant ID. Required only if Microsoft SSO is enabled.

Notes​

  • All variables must be prefixed with VITE_ — this is a Vite requirement. Variables without this prefix are not exposed to the browser.
  • These values are baked into the build at compile time. Changing a .env value requires rebuilding the app (npm run build).
  • Never commit .env to version control. Add it to .gitignore.
  • For production, these values are injected by the Jenkins pipeline via credentials stored in Jenkins.