Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Environment Variables
Complete catalog of all environment variables across GrantMaster workspaces.
Copy the relevant .env.example file and fill in values for local development.
Quick Setup
# 1. Frontend
cp .env.example .env.local
# 2. Backend (Cloud Functions)
cp functions/.env.example functions/.env
# 3. Fill in required values (see tables below)
Frontend Variables (/.env.local)
Firebase Configuration (Required)
| Variable | Required | Description | Example |
|---|
VITE_FIREBASE_API_KEY | Yes | Firebase project API key | AIzaSy... |
VITE_FIREBASE_AUTH_DOMAIN | Yes | Firebase Auth domain | your-project.firebaseapp.com |
VITE_FIREBASE_PROJECT_ID | Yes | Firebase project ID | your-project-id |
VITE_FIREBASE_STORAGE_BUCKET | Yes | Firebase Storage bucket | your-project.firebasestorage.app |
VITE_FIREBASE_MESSAGING_SENDER_ID | Yes | FCM sender ID | 123456789 |
VITE_FIREBASE_APP_ID | Yes | Firebase app identifier | 1:123456789:web:abc123 |
Tip: When running against emulators only, placeholder values are acceptable for all Firebase config variables.
Application Environment
| Variable | Required | Default | Description |
|---|
VITE_APP_ENV | No | development | Environment identifier (development, staging, production). Controls feature gates and behavior. |
VITE_USE_EMULATORS | No | true | Connect to local Firebase emulators in dev mode. Set to false to hit a live Firebase project. |
VITE_APP_VERSION | No | Git SHA / package.json version | App version string used in Sentry releases and FCM metadata. Usually set automatically by CI. |
Sentry Error Tracking (Optional)
| Variable | Required | Description | Example |
|---|
VITE_SENTRY_DSN | No | Browser-side Sentry DSN. Sentry is disabled when absent. | https://key@o0.ingest.de.sentry.io/0 |
VITE_SENTRY_RELEASE | No | Override release name for sourcemaps and runtime. Falls back to SENTRY_RELEASE, GITHUB_SHA, or VITE_APP_VERSION. | 1.2.3 |
SENTRY_DSN | No | Server-side Sentry DSN (Cloud Functions). | https://key@o0.ingest.de.sentry.io/0 |
SENTRY_RELEASE | No | Server-side release name override. | 1.2.3 |
SENTRY_UPLOAD_SOURCEMAPS | No | Enable sourcemap upload during build. Default false; set to true in CI. | false |
SENTRY_ORG | No | Sentry organization slug (build-time only). | my-org |
SENTRY_PROJECT | No | Sentry project slug (build-time only). | grantmaster |
SENTRY_AUTH_TOKEN | No | Auth token for sourcemap uploads (build-time only). | sntrys_ey... |
Stripe (Required for billing features)
| Variable | Required | Description | Example |
|---|
VITE_STRIPE_PUBLISHABLE_KEY | Yes* | Publishable key for client-side Stripe.js. Required if billing features are used. | pk_test_... |
VITE_STRIPE_JS_URL | No | Override for the hosted Stripe.js script URL. Default: https://js.stripe.com/v3/ | https://js.stripe.com/v3/ |
Google AI / Gemini (Optional)
| Variable | Required | Description | Example |
|---|
VITE_GEMINI_API_KEY | No | Browser-side Gemini API key used by AI features (compliance extraction, document Q&A, forecasting). Missing it does not block app startup; AI features degrade gracefully in dev. | AIzaSy... |
Google Cloud Vision (Optional)
| Variable | Required | Description | Example |
|---|
VITE_GOOGLE_CLOUD_VISION_API_KEY | No | API key for receipt OCR via Cloud Vision. | AIzaSy... |
VITE_GOOGLE_CLOUD_VISION_API_URL | No | Vision annotate endpoint override. Default: https://vision.googleapis.com/v1/images:annotate | |
Google Calendar Integration (Optional)
| Variable | Required | Description | Example |
|---|
VITE_ENABLE_GOOGLE_CALENDAR | No | Set to true to enable Google Calendar integration. | true |
VITE_GOOGLE_CLIENT_ID | No | Google OAuth client ID. Required when Google Calendar is enabled. | 123...apps.googleusercontent.com |
Analytics (Optional)
| Variable | Required | Default | Description |
|---|
VITE_FIREBASE_MEASUREMENT_ID | No | G-PLACEHOLDER | Google Analytics measurement ID. |
VITE_ENABLE_ANALYTICS | No | false | Enable Firebase Analytics. |
HubSpot Integration (Optional)
| Variable | Required | Default | Description |
|---|
VITE_HUBSPOT_API_BASE_URL | No | https://api.hubapi.com | HubSpot REST API base URL. |
VITE_HUBSPOT_OAUTH_BASE_URL | No | (empty) | HubSpot OAuth base URL override. |
VITE_HUBSPOT_APP_OAUTH_BASE_URL | No | https://app.hubspot.com/oauth | HubSpot App OAuth URL. |
VITE_HUBSPOT_EU_OAUTH_BASE_URL | No | https://mcp-eu1.hubspot.com/oauth | HubSpot EU region OAuth URL. |
VITE_HUBSPOT_OAUTH_TOKEN_ENDPOINT | No | https://api.hubapi.com/oauth/v1/token | Token exchange endpoint. |
VITE_HUBSPOT_ACCOUNT_INFO_URL | No | https://api.hubapi.com/account-info/v3/details | Account info endpoint. |
Typesense Search (Optional)
| Variable | Required | Default | Description |
|---|
VITE_TYPESENSE_HOST | No | (empty) | Typesense Cloud host. Required for direct client search mode. |
VITE_TYPESENSE_SEARCH_API_KEY | No | (empty) | Read-only Typesense search key. Required for direct client search mode. |
VITE_TYPESENSE_PORT | No | 443 | Typesense server port. |
VITE_TYPESENSE_PROTOCOL | No | https | Typesense connection protocol. |
VITE_TYPESENSE_USE_CLOUD_FUNCTIONS | No | false | Set to true to route command palette search through the searchTypesenseSecure Cloud Function instead of calling Typesense directly from the browser. Recommended for staging/production. |
Postmark Email (Frontend - Optional)
These variables are read by frontend email management UI components for display/configuration purposes.
| Variable | Required | Description | Example |
|---|
VITE_POSTMARK_SERVER_TOKEN | No | Postmark server API token. Used by email test components. | your-token |
VITE_POSTMARK_FROM_EMAIL | No | Default sender email address. | noreply@example.com |
VITE_POSTMARK_FROM_NAME | No | Default sender display name. | GrantMaster |
VITE_POSTMARK_SERVER_ID | No | Postmark server ID for template management UI. | 17630028 |
Feature Flags (Optional)
| Variable | Required | Default | Description |
|---|
VITE_ENABLE_FLOATING_ASSISTANT | No | false | Enable the floating AI assistant in the nav/modal system. |
VITE_ENABLE_QUERY_DEVTOOLS | No | false | Show React Query devtools panel (dev mode only). |
Internationalization (Optional)
| Variable | Required | Description |
|---|
VITE_I18N_BACKEND_BASE | No | Base URL for remote i18n translation backend. When unset, bundled translations are used. |
App Check / reCAPTCHA (Optional)
| Variable | Required | Description |
|---|
VITE_RECAPTCHA_SITE_KEY | No | reCAPTCHA v3 site key for Firebase App Check. App Check is skipped when missing. |
Backend Variables (/functions/.env)
These variables configure Firebase Cloud Functions. For local development, copy functions/.env.example to functions/.env.
Stripe
| Variable | Required | Description | Example |
|---|
STRIPE_SECRET_KEY | Yes* | Stripe secret key (test mode for dev). Never expose in frontend code. | sk_test_... |
STRIPE_WEBHOOK_SECRET | No | Webhook endpoint signing secret for verifying Stripe events. | whsec_... |
Application URLs
| Variable | Required | Default | Description |
|---|
APP_URL | No | http://localhost:3000 | Application URL used for Stripe Checkout redirects and email links. |
WEBAPP_URL | No | Falls back to APP_URL | Alternative app URL variable used by invitation and referral emails. |
SUPPORT_EMAIL | No | support@grantmaster.ai | Support email address included in transactional emails. |
App Check
| Variable | Required | Description |
|---|
RECAPTCHA_SECRET_KEY | No | reCAPTCHA secret key for server-side App Check verification. |
Postmark (Email)
| Variable | Required | Default | Description |
|---|
POSTMARK_SERVER_TOKEN | Yes* | (none) | Postmark server API token. Required for sending transactional emails. Also read from VITE_POSTMARK_SERVER_TOKEN as fallback (emulator compat). |
POSTMARK_FROM_EMAIL | No | noreply@grantmaster.ai | Sender email for outbound emails. Falls back to VITE_POSTMARK_FROM_EMAIL. |
POSTMARK_FROM_NAME | No | GrantMaster | Sender display name. Falls back to VITE_POSTMARK_FROM_NAME. |
VITE_POSTMARK_SERVER_TOKEN | No | (none) | Emulator-only alias for POSTMARK_SERVER_TOKEN. |
VITE_POSTMARK_FROM_EMAIL | No | noreply@example.com | Emulator-only alias for POSTMARK_FROM_EMAIL. |
VITE_POSTMARK_FROM_NAME | No | GrantControl Local | Emulator-only alias for POSTMARK_FROM_NAME. |
Typesense (Server-Side Indexing)
| Variable | Required | Default | Description |
|---|
TYPESENSE_API_KEY | No | (none) | Typesense admin API key for server-side indexing operations. |
TYPESENSE_HOST | No | (none) | Typesense Cloud host. |
TYPESENSE_PORT | No | 443 | Typesense server port. |
TYPESENSE_PROTOCOL | No | https | Typesense connection protocol. |
Webhooks
| Variable | Required | Description |
|---|
FRAMER_WEBHOOK_SECRET | No | Secret for verifying inbound Framer waitlist webhooks. |
AI / Gemini (Server-Side)
| Variable | Required | Description |
|---|
GEMINI_API_KEY | No | Server-side Gemini API key used by Genkit Cloud Functions (RAG, predictions, journal generation). Managed as a GCP secret. |
System Variables (Auto-Set)
These are set by the Firebase runtime and should not be manually configured:
| Variable | Description |
|---|
FUNCTIONS_EMULATOR | Set to true automatically when running in the local emulator. |
GCLOUD_PROJECT | GCP project ID, set automatically by the Firebase runtime. |
Portal Variables (/portal/.env)
The portal app is a separate Vite build and reads the same Firebase config variables as the main app.
| Variable | Required | Description |
|---|
VITE_FIREBASE_API_KEY | Yes | Firebase project API key (can share with main app). |
VITE_FIREBASE_AUTH_DOMAIN | Yes | Firebase Auth domain. |
VITE_FIREBASE_PROJECT_ID | Yes | Firebase project ID. |
VITE_FIREBASE_STORAGE_BUCKET | Yes | Firebase Storage bucket. |
VITE_FIREBASE_MESSAGING_SENDER_ID | Yes | FCM sender ID. |
VITE_FIREBASE_APP_ID | Yes | Firebase app identifier. |
VITE_USE_EMULATORS | No | Connect to local Firebase emulators (same as main app). |
No .env.example exists for the portal yet. Copy values from the root .env.local.
Production / Staging
GCP Secret Manager
In production and staging, sensitive values are stored as GCP secrets and declared in Cloud Function definitions via the secrets option. They are injected as environment variables at runtime.
| Secret Name | Maps To | Used By |
|---|
STRIPE_SECRET_KEY | process.env.STRIPE_SECRET_KEY | Stripe checkout, payment methods, webhooks |
STRIPE_WEBHOOK_SECRET | process.env.STRIPE_WEBHOOK_SECRET | Stripe webhook signature verification |
POSTMARK_SERVER_TOKEN | process.env.POSTMARK_SERVER_TOKEN | All transactional email functions |
FRAMER_WEBHOOK_SECRET | process.env.FRAMER_WEBHOOK_SECRET | Waitlist webhook verification |
GEMINI_API_KEY | process.env.GEMINI_API_KEY | Genkit AI functions, RAG, predictions |
To set a secret:
firebase functions:secrets:set STRIPE_SECRET_KEY
firebase functions:secrets:set POSTMARK_SERVER_TOKEN
firebase functions:secrets:set GEMINI_API_KEY
Environment-Specific Values
| Variable | Development | Staging | Production |
|---|
VITE_APP_ENV | development | staging | production |
VITE_USE_EMULATORS | true | false | false |
VITE_ENABLE_ANALYTICS | false | true | true |
VITE_SENTRY_DSN | (optional) | Set | Set |
SENTRY_UPLOAD_SOURCEMAPS | false | true (CI) | true (CI) |
VITE_STRIPE_PUBLISHABLE_KEY | pk_test_... | pk_test_... | pk_live_... |
VITE_TYPESENSE_USE_CLOUD_FUNCTIONS | false | true | true |
APP_URL | http://localhost:3000 | https://staging.grantmaster.app | https://app.grantmaster.ai |
Emulator Configuration
| Variable | Default | Purpose |
|---|
VITE_USE_EMULATORS | true | Use local Firebase emulators instead of a live project. |
Emulator ports are hardcoded in firebase.json and vite.config.ts and cannot be changed via environment variables:
| Service | Port |
|---|
| Vite Dev Server | 3000 |
| Firebase Emulator UI | 4000 |
| Functions Emulator | 5001 |
| Firestore Emulator | 8080 |
| Auth Emulator | 9099 |
| Storage Emulator | 9199 |
Warning: Never override the Vite port (3000) — it is hardcoded for Firebase integration.
Maintenance
Update this document when:
- Adding new environment variables or integrations.
- Changing which variables are required vs. optional.
- Adding new GCP secrets for Cloud Functions.
- Modifying emulator ports.