Skip to content

Environment Variables

If you are self-hosting Plan AI, you will need to configure environment variables for all three of the core backend applications (The Node API, the React Frontend, and the Python Voice API).

Global Configuration

Plan AI uses a master script to generate .env templates across the entire monorepo. From the root of the repository, run:

bash
yarn setup:env

Backend Variables (plan-ai/backend/.env)

This is the most critical environment file. It handles database connections, API keys, integrations, and internal service discovery.

VariableDescriptionExample
Core & Services
ENVThe environment you are running in.local
PORTThe port the Express API runs on.8080
FRONTEND_URLThe public URL of the frontend app (for CORS).http://localhost:3000
BACKEND_URLThe public URL of this API (for webhooks).https://api.plan-ai.com
APP_URLThe main URL of the app (used in emails).https://plan-ai.blueberrybytes.com
CORS_ORIGINSComma-separated list of allowed CORS origins for production. Leave empty for local dev (allows all origins).https://plan-ai.blueberrybytes.com
API_ADMIN_KEYSecret key for cron jobs or admin overrides.test123
LOG_LEVELLogging verbosity (info, debug, error).info
Databases
DATABASE_URLPostgreSQL connection string.postgresql://planai:planai123@localhost/planai_db
REDIS_URLRedis connection for BullMQ jobs.redis://localhost:6379
QDRANT_URLVector Database connection.http://127.0.0.1:6333
QDRANT_CONTEXT_COLLECTIONThe name of the collection for contexts.context_files
BullMQ Dashboard
BULL_BOARD_USERBasic auth username for the queue dashboard.admin
BULL_BOARD_PASSWORDBasic auth password for the queue dashboard.admin
AI Providers
OPENROUTER_API_KEYSystem-level OpenRouter fallback key.sk-or-v1-xxxx
DEEPGRAM_API_KEYSystem-level Deepgram fallback key.xxxx
OPENAI_API_KEYOptional OpenAI key.sk-proj-xxxx
GROQ_API_KEYOptional Groq key.gsk_xxxx
VOICE_AI_URLInternal URL for the Python Voice API.http://localhost:8001
VOICE_AI_API_KEYShared secret between the backend and voice-ai service. Leave empty for local dev.your-secret-key
Integrations
JIRA_CLIENT_IDOAuth Client ID for Jira integration.xxxx
JIRA_CLIENT_SECRETOAuth Client Secret for Jira integration.xxxx
JIRA_REDIRECT_URIJira OAuth callback URL.http://localhost:8080/api/jira/callback
TRELLO_GLOBAL_API_KEYTrello global API key for automated OAuth.xxxx
GITHUB_APP_IDGitHub App ID for codebase connection.xxxx
GITHUB_WEBHOOK_SECRETSecret for GitHub webhooks.xxxx
GITHUB_PRIVATE_KEYThe private key for the GitHub App.-----BEGIN RSA PRIVATE KEY-----...
USE_GITNEXUSEnable local GitNexus MCP indexing.false
GITNEXUS_MCP_URLURL for the GitNexus MCP Server.http://localhost:4747/api/mcp
LINEAR_CLIENT_IDOAuth Client ID for Linear integration.xxxx
LINEAR_CLIENT_SECRETOAuth Client Secret for Linear integration.xxxx
LINEAR_REDIRECT_URILinear OAuth callback URL.http://localhost:8080/api/linear/callback
LINEAR_WEBHOOK_SECRETSecret for Linear webhooks (optional).xxxx
GOOGLE_CLIENT_IDGoogle OAuth ID (Drive integration).xxxx
GOOGLE_CLIENT_SECRETGoogle OAuth Secret.xxxx
GOOGLE_REDIRECT_URIGoogle OAuth callback URL.http://localhost:8080/api/google/callback
MICROSOFT_CLIENT_IDMicrosoft OAuth client ID (OneDrive integration).xxxx
MICROSOFT_CLIENT_SECRETMicrosoft OAuth client secret.xxxx
MICROSOFT_TENANT_IDMicrosoft Azure tenant ID.xxxx
MICROSOFT_REDIRECT_URIMicrosoft OAuth callback URL.http://localhost:8080/api/microsoft/callback
NOTION_OAUTH_CLIENT_IDNotion OAuth client ID.xxxx
NOTION_OAUTH_CLIENT_SECRETNotion OAuth client secret.xxxx
NOTION_REDIRECT_URINotion OAuth callback URL.http://localhost:8080/api/notion/callback
Auth & Email
FIREBASE_SERVICE_KEYBase64 encoded Firebase Service Account JSON.=
FIREBASE_STORAGE_BUCKETFirebase Storage bucket name.plan-ai.appspot.com
RESEND_API_KEYResend API key for transactional emails.re_xxxx
FROM_EMAILSender address for system emails.noreply@plan-ai.blueberrybytes.com
Stripe Billing (optional) — see Stripe Billing setup
STRIPE_SECRET_KEYStripe secret key. Leave empty to disable billing entirely (OSS default).sk_test_…
STRIPE_WEBHOOK_SECRETWebhook signing secret from Stripe Dashboard or CLI.whsec_…
STRIPE_PRICE_PRO_BYOKStripe Price ID for the Pro BYOK tier (€6/seat/month).price_…
STRIPE_PRICE_PRO_MANAGEDStripe Price ID for the Pro Managed tier (€29/seat/month).price_…
STRIPE_PRICE_BUSINESS_BYOKStripe Price ID for the Business BYOK tier (€14/seat/month).price_…
STRIPE_PRICE_BUSINESS_MANAGEDStripe Price ID for the Business Managed tier (€65/seat/month).price_…
STRIPE_CHECKOUT_SUCCESS_PATHPath appended to APP_URL for Stripe success redirect./billing?status=success
STRIPE_CHECKOUT_CANCEL_PATHPath appended to APP_URL for Stripe cancel redirect./billing?status=canceled

Frontend Variables (plan-ai/frontend/.env)

These variables are exposed to the React frontend application using Create React App (REACT_APP_ prefix).

VariableDescriptionExample
PORTLocal dev port for React.3000
REACT_APP_API_BACKEND_URLThe URL of your Node Backend API.http://localhost:8080
REACT_APP_ENVEnvironment context for the UI.local
REACT_APP_ENABLE_REMOTE_LOGSEnable/disable sending logs remotely.false
Firebase Auth
REACT_APP_FIREBASE_API_KEYPublic Firebase API Key.AIzaSy...
REACT_APP_FIREBASE_APP_IDPublic Firebase App ID.1:1234:web:abcd
REACT_APP_FIREBASE_AUTH_DOMAINFirebase Auth Domain.plan-ai-1234.firebaseapp.com
REACT_APP_FIREBASE_PROJECT_IDFirebase Project ID.plan-ai-1234
REACT_APP_FIREBASE_STORAGE_BUCKETFirebase Storage bucket.plan-ai-1234.appspot.com
REACT_APP_FIREBASE_MEASUREMENT_IDFirebase Analytics ID.G-1234
REACT_APP_FIREBASE_MESSAGING_SENDER_IDFirebase Messaging ID.12345
Google Integrations
REACT_APP_GOOGLE_CLIENT_IDFor Google Drive / Docs picker.xxxx.apps.googleusercontent.com
REACT_APP_GOOGLE_API_KEYFor Google Drive API access.AIzaSy...
REACT_APP_GOOGLE_APP_IDGoogle App ID.1234567890

Voice Service Variables (plan-ai/voice-ai/.env)

This powers the deep-learning speaker identification system.

VariableDescriptionExample
PORTThe port the FastAPI service runs on.8001
HOSTThe binding host.0.0.0.0
HF_HOMEDirectory for caching HuggingFace models../.cache/huggingface
VOICE_AI_API_KEYShared secret to authenticate requests from the backend. Must match the backend value.your-secret-key
VOICE_REQUEST_TIMEOUTRequest timeout in seconds (default: 180).180

Desktop Recorder Variables (plan-ai-recorder/.env)

The Electron desktop application uses Vite, so all public variables are prefixed with VITE_.

VariableDescriptionExample
VITE_PLAN_AI_API_URLThe URL of the Node Backend API.http://localhost:8080
VITE_PLAN_AI_WEB_URLThe URL of the Web Dashboard.http://localhost:3000
VITE_APP_PROTOCOLThe deep-linking protocol scheme.blueberrybytes-recorder
VITE_LOGIN_BUGDev flag for debugging the auth flow.false
Firebase Auth
VITE_FIREBASE_API_KEYPublic Firebase API Key.AIzaSy...
VITE_FIREBASE_AUTH_DOMAINFirebase Auth Domain.plan-ai-1234.firebaseapp.com
VITE_FIREBASE_PROJECT_IDFirebase Project ID.plan-ai-1234
VITE_FIREBASE_STORAGE_BUCKETFirebase Storage bucket.plan-ai-1234.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_IDFirebase Messaging ID.12345
VITE_FIREBASE_APP_IDPublic Firebase App ID.1:1234:web:abcd
VITE_FIREBASE_MEASUREMENT_IDFirebase Analytics ID.G-1234
VITE_SENTRY_DSNSentry DSN for error tracking.https://xxxx@sentry.io/xxx

Mobile App Variables (plan-ai-mobile/.env.local)

The React Native (Expo) app uses EXPO_PUBLIC_ prefixes so variables are securely bundled into the native IPA/APK.

VariableDescriptionExample
APP_ENVModifies app.config.ts bundle identities.development
EXPO_PUBLIC_PLAN_AI_API_URLThe URL of the Node Backend API.http://localhost:8080 or http://192.168.1.44:8080
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_IDGoogle Client ID for mobile auth.xxxx.apps.googleusercontent.com
SENTRY_AUTH_TOKENSecret token for uploading source maps to Sentry.sntrys_xxxx

Firebase Native Configuration

In addition to the environment variables above, the native mobile app requires actual configuration files from your Firebase Console. You must download these files and place them in the root of the plan-ai-mobile directory:

  • google-services.json (For Android)
  • GoogleService-Info.plist (For iOS)

⚠️ Security Warning: Do NOT commit these files to a public repository! They are included in the .gitignore by default. While they are embedded in your final public APK/IPA, committing them raw allows forks to accidentally use your Firebase backend for their environments.