Skip to main content

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)

VariableRequiredDescriptionExample
VITE_FIREBASE_API_KEYYesFirebase project API keyAIzaSy...
VITE_FIREBASE_AUTH_DOMAINYesFirebase Auth domainyour-project.firebaseapp.com
VITE_FIREBASE_PROJECT_IDYesFirebase project IDyour-project-id
VITE_FIREBASE_STORAGE_BUCKETYesFirebase Storage bucketyour-project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_IDYesFCM sender ID123456789
VITE_FIREBASE_APP_IDYesFirebase app identifier1:123456789:web:abc123
Tip: When running against emulators only, placeholder values are acceptable for all Firebase config variables.

Application Environment

VariableRequiredDefaultDescription
VITE_APP_ENVNodevelopmentEnvironment identifier (development, staging, production). Controls feature gates and behavior.
VITE_USE_EMULATORSNotrueConnect to local Firebase emulators in dev mode. Set to false to hit a live Firebase project.
VITE_APP_VERSIONNoGit SHA / package.json versionApp version string used in Sentry releases and FCM metadata. Usually set automatically by CI.

Sentry Error Tracking (Optional)

VariableRequiredDescriptionExample
VITE_SENTRY_DSNNoBrowser-side Sentry DSN. Sentry is disabled when absent.https://key@o0.ingest.de.sentry.io/0
VITE_SENTRY_RELEASENoOverride release name for sourcemaps and runtime. Falls back to SENTRY_RELEASE, GITHUB_SHA, or VITE_APP_VERSION.1.2.3
SENTRY_DSNNoServer-side Sentry DSN (Cloud Functions).https://key@o0.ingest.de.sentry.io/0
SENTRY_RELEASENoServer-side release name override.1.2.3
SENTRY_UPLOAD_SOURCEMAPSNoEnable sourcemap upload during build. Default false; set to true in CI.false
SENTRY_ORGNoSentry organization slug (build-time only).my-org
SENTRY_PROJECTNoSentry project slug (build-time only).grantmaster
SENTRY_AUTH_TOKENNoAuth token for sourcemap uploads (build-time only).sntrys_ey...

Stripe (Required for billing features)

VariableRequiredDescriptionExample
VITE_STRIPE_PUBLISHABLE_KEYYes*Publishable key for client-side Stripe.js. Required if billing features are used.pk_test_...
VITE_STRIPE_JS_URLNoOverride for the hosted Stripe.js script URL. Default: https://js.stripe.com/v3/https://js.stripe.com/v3/

Google AI / Gemini (Optional)

VariableRequiredDescriptionExample
VITE_GEMINI_API_KEYNoBrowser-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)

VariableRequiredDescriptionExample
VITE_GOOGLE_CLOUD_VISION_API_KEYNoAPI key for receipt OCR via Cloud Vision.AIzaSy...
VITE_GOOGLE_CLOUD_VISION_API_URLNoVision annotate endpoint override. Default: https://vision.googleapis.com/v1/images:annotate

Google Calendar Integration (Optional)

VariableRequiredDescriptionExample
VITE_ENABLE_GOOGLE_CALENDARNoSet to true to enable Google Calendar integration.true
VITE_GOOGLE_CLIENT_IDNoGoogle OAuth client ID. Required when Google Calendar is enabled.123...apps.googleusercontent.com

Analytics (Optional)

VariableRequiredDefaultDescription
VITE_FIREBASE_MEASUREMENT_IDNoG-PLACEHOLDERGoogle Analytics measurement ID.
VITE_ENABLE_ANALYTICSNofalseEnable Firebase Analytics.

HubSpot Integration (Optional)

VariableRequiredDefaultDescription
VITE_HUBSPOT_API_BASE_URLNohttps://api.hubapi.comHubSpot REST API base URL.
VITE_HUBSPOT_OAUTH_BASE_URLNo(empty)HubSpot OAuth base URL override.
VITE_HUBSPOT_APP_OAUTH_BASE_URLNohttps://app.hubspot.com/oauthHubSpot App OAuth URL.
VITE_HUBSPOT_EU_OAUTH_BASE_URLNohttps://mcp-eu1.hubspot.com/oauthHubSpot EU region OAuth URL.
VITE_HUBSPOT_OAUTH_TOKEN_ENDPOINTNohttps://api.hubapi.com/oauth/v1/tokenToken exchange endpoint.
VITE_HUBSPOT_ACCOUNT_INFO_URLNohttps://api.hubapi.com/account-info/v3/detailsAccount info endpoint.

Typesense Search (Optional)

VariableRequiredDefaultDescription
VITE_TYPESENSE_HOSTNo(empty)Typesense Cloud host. Required for direct client search mode.
VITE_TYPESENSE_SEARCH_API_KEYNo(empty)Read-only Typesense search key. Required for direct client search mode.
VITE_TYPESENSE_PORTNo443Typesense server port.
VITE_TYPESENSE_PROTOCOLNohttpsTypesense connection protocol.
VITE_TYPESENSE_USE_CLOUD_FUNCTIONSNofalseSet 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.
VariableRequiredDescriptionExample
VITE_POSTMARK_SERVER_TOKENNoPostmark server API token. Used by email test components.your-token
VITE_POSTMARK_FROM_EMAILNoDefault sender email address.noreply@example.com
VITE_POSTMARK_FROM_NAMENoDefault sender display name.GrantMaster
VITE_POSTMARK_SERVER_IDNoPostmark server ID for template management UI.17630028

Feature Flags (Optional)

VariableRequiredDefaultDescription
VITE_ENABLE_FLOATING_ASSISTANTNofalseEnable the floating AI assistant in the nav/modal system.
VITE_ENABLE_QUERY_DEVTOOLSNofalseShow React Query devtools panel (dev mode only).

Internationalization (Optional)

VariableRequiredDescription
VITE_I18N_BACKEND_BASENoBase URL for remote i18n translation backend. When unset, bundled translations are used.

App Check / reCAPTCHA (Optional)

VariableRequiredDescription
VITE_RECAPTCHA_SITE_KEYNoreCAPTCHA 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

VariableRequiredDescriptionExample
STRIPE_SECRET_KEYYes*Stripe secret key (test mode for dev). Never expose in frontend code.sk_test_...
STRIPE_WEBHOOK_SECRETNoWebhook endpoint signing secret for verifying Stripe events.whsec_...

Application URLs

VariableRequiredDefaultDescription
APP_URLNohttp://localhost:3000Application URL used for Stripe Checkout redirects and email links.
WEBAPP_URLNoFalls back to APP_URLAlternative app URL variable used by invitation and referral emails.
SUPPORT_EMAILNosupport@grantmaster.aiSupport email address included in transactional emails.

App Check

VariableRequiredDescription
RECAPTCHA_SECRET_KEYNoreCAPTCHA secret key for server-side App Check verification.

Postmark (Email)

VariableRequiredDefaultDescription
POSTMARK_SERVER_TOKENYes*(none)Postmark server API token. Required for sending transactional emails. Also read from VITE_POSTMARK_SERVER_TOKEN as fallback (emulator compat).
POSTMARK_FROM_EMAILNonoreply@grantmaster.aiSender email for outbound emails. Falls back to VITE_POSTMARK_FROM_EMAIL.
POSTMARK_FROM_NAMENoGrantMasterSender display name. Falls back to VITE_POSTMARK_FROM_NAME.
VITE_POSTMARK_SERVER_TOKENNo(none)Emulator-only alias for POSTMARK_SERVER_TOKEN.
VITE_POSTMARK_FROM_EMAILNonoreply@example.comEmulator-only alias for POSTMARK_FROM_EMAIL.
VITE_POSTMARK_FROM_NAMENoGrantControl LocalEmulator-only alias for POSTMARK_FROM_NAME.

Typesense (Server-Side Indexing)

VariableRequiredDefaultDescription
TYPESENSE_API_KEYNo(none)Typesense admin API key for server-side indexing operations.
TYPESENSE_HOSTNo(none)Typesense Cloud host.
TYPESENSE_PORTNo443Typesense server port.
TYPESENSE_PROTOCOLNohttpsTypesense connection protocol.

Webhooks

VariableRequiredDescription
FRAMER_WEBHOOK_SECRETNoSecret for verifying inbound Framer waitlist webhooks.

AI / Gemini (Server-Side)

VariableRequiredDescription
GEMINI_API_KEYNoServer-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:
VariableDescription
FUNCTIONS_EMULATORSet to true automatically when running in the local emulator.
GCLOUD_PROJECTGCP 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.
VariableRequiredDescription
VITE_FIREBASE_API_KEYYesFirebase project API key (can share with main app).
VITE_FIREBASE_AUTH_DOMAINYesFirebase Auth domain.
VITE_FIREBASE_PROJECT_IDYesFirebase project ID.
VITE_FIREBASE_STORAGE_BUCKETYesFirebase Storage bucket.
VITE_FIREBASE_MESSAGING_SENDER_IDYesFCM sender ID.
VITE_FIREBASE_APP_IDYesFirebase app identifier.
VITE_USE_EMULATORSNoConnect 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 NameMaps ToUsed By
STRIPE_SECRET_KEYprocess.env.STRIPE_SECRET_KEYStripe checkout, payment methods, webhooks
STRIPE_WEBHOOK_SECRETprocess.env.STRIPE_WEBHOOK_SECRETStripe webhook signature verification
POSTMARK_SERVER_TOKENprocess.env.POSTMARK_SERVER_TOKENAll transactional email functions
FRAMER_WEBHOOK_SECRETprocess.env.FRAMER_WEBHOOK_SECRETWaitlist webhook verification
GEMINI_API_KEYprocess.env.GEMINI_API_KEYGenkit 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

VariableDevelopmentStagingProduction
VITE_APP_ENVdevelopmentstagingproduction
VITE_USE_EMULATORStruefalsefalse
VITE_ENABLE_ANALYTICSfalsetruetrue
VITE_SENTRY_DSN(optional)SetSet
SENTRY_UPLOAD_SOURCEMAPSfalsetrue (CI)true (CI)
VITE_STRIPE_PUBLISHABLE_KEYpk_test_...pk_test_...pk_live_...
VITE_TYPESENSE_USE_CLOUD_FUNCTIONSfalsetruetrue
APP_URLhttp://localhost:3000https://staging.grantmaster.apphttps://app.grantmaster.ai

Emulator Configuration

VariableDefaultPurpose
VITE_USE_EMULATORStrueUse 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:
ServicePort
Vite Dev Server3000
Firebase Emulator UI4000
Functions Emulator5001
Firestore Emulator8080
Auth Emulator9099
Storage Emulator9199
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.