Skip to content

Environment Variables

Lokus reads environment variables from a .env file in the project root. Copy the example file to get started:

Terminal window
cp .env.example .env

Base URL for the authentication backend.

ModeDefault
Development (npm run dev)http://localhost:3000
Production (npm run build)https://lokusmd.com
Terminal window
VITE_AUTH_BASE_URL=https://lokusmd.com

Used for sign-up, sign-in, OAuth flows, email confirmation links, and profile management. The value is baked into the frontend at build time.

Rust-side equivalent of VITE_AUTH_BASE_URL. Automatically matches the frontend value. Override only if the backend needs a different endpoint.

Google OAuth Client ID for Gmail integration. Required only if you enable Gmail features.

Terminal window
GOOGLE_CLIENT_ID=your_client_id_here

Create one at Google Cloud Console > Credentials > OAuth 2.0 Client IDs. Set application type to “Desktop application” and add http://localhost:8080/gmail-callback as an authorized redirect URI.

Google OAuth Client Secret. Paired with GOOGLE_CLIENT_ID above.

Terminal window
GOOGLE_CLIENT_SECRET=your_client_secret_here

Enable Sentry crash reporting. Default: false.

Terminal window
VITE_ENABLE_CRASH_REPORTS=true

Sentry DSN for the Rust backend. Only used when VITE_ENABLE_CRASH_REPORTS is true.

Terminal window
TAURI_SENTRY_DSN=https://your-dsn@sentry.io/project-id

Sentry environment label. Default: production.

Terminal window
VITE_SENTRY_ENVIRONMENT=staging

Disable the auto-update check. Used for App Store builds where updates go through the store.

Terminal window
VITE_DISABLE_UPDATE_CHECKER=true

In development (npm run dev), Vite reads the .env file and injects VITE_-prefixed variables into the frontend. The Rust backend loads .env via dotenvy at startup.

In production (npm run build), VITE_-prefixed variables are baked into the JavaScript bundle at build time. Changing them after the build has no effect — you must rebuild.

  • Never commit .env files with real credentials. The .gitignore already excludes .env.
  • Rotate credentials immediately if they are accidentally exposed.
  • Use .env.example for documenting variable names without real values.