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​
| Variable | Required | Description |
|---|---|---|
VITE_MEDPLUM_BASE_URL | Yes | URL of the ChartChat server API. Use http://localhost:8103/ for local dev. |
VITE_MEDPLUM_PROJECT_ID | Yes | The Medplum project ID this portal belongs to. Found in the Admin Portal under project settings. |
VITE_MEDPLUM_CLIENT_APP_ID | Yes | The Medplum client application ID used for OAuth. Created in the Admin Portal. |
VITE_MEDPLUM_GOOGLE_CLIENT_ID | No | Google OAuth 2.0 client ID. Required only if Google Sign-In is enabled. |
VITE_RECAPTCHA_SITE_KEY | No | Google reCAPTCHA v2 site key. Required for the password reset form in Settings. |
VITE_MICROSOFT_CLIENT_ID | No | Azure AD application (client) ID. Required only if Microsoft SSO is enabled. |
VITE_MICROSOFT_TENANT_ID | No | Azure 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
.envvalue requires rebuilding the app (npm run build). - Never commit
.envto version control. Add it to.gitignore. - For production, these values are injected by the Jenkins pipeline via credentials stored in Jenkins.