Foundry reads environment variables from three locations depending on the service. This page documents every variable, where it is set, and whether it is required for local development.
Location What goes here .env.localNext.js frontend vars (NEXT_PUBLIC_*), Clerk keys, local dev URLs Convex Dashboard Backend secrets — Anthropic API key, webhook secrets, service URLs Wrangler Secrets Cloudflare Worker secrets — sandbox and agent worker auth
Variable Where Purpose Default Required NEXT_PUBLIC_CONVEX_URL.env.localConvex deployment URL for client WebSocket connection — Yes CONVEX_DEPLOYMENT.env.localConvex deployment identifier (set by bunx convex dev) — Yes NEXT_PUBLIC_CONVEX_SITE_URL.env.localConvex HTTP actions URL (for webhook endpoints) — Yes
Variable Where Purpose Default Required NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY.env.localClerk frontend authentication key — Yes CLERK_SECRET_KEY.env.localClerk backend key for server-side verification — Yes CLERK_JWT_ISSUER_DOMAIN.env.localClerk JWT issuer domain for token validation — Yes CLERK_WEBHOOK_SECRETConvex Dashboard HMAC secret for Clerk webhook signature verification — Yes (for user sync)
Variable Where Purpose Default Required ANTHROPIC_API_KEYConvex Dashboard Claude API key for AI analysis, decomposition, code generation — Yes
Variable Where Purpose Default Required AGENT_SERVICE_URL.env.local + Convex DashboardURL of the agent inference service http://localhost:3001Yes AGENT_SERVICE_SECRETConvex Dashboard + Wrangler Bearer token for agent worker authentication (production only) — No (local dev)
In local development, the agent service runs on port 3001 without bearer auth. In production, set AGENT_SERVICE_URL to your Cloudflare Worker URL and configure AGENT_SERVICE_SECRET as a shared secret.
Variable Where Purpose Default Required NEXT_PUBLIC_GITHUB_APP_SLUG.env.localGitHub App slug for installation links — No GITHUB_APP_ID.env.localGitHub App numeric ID — No GITHUB_APP_CLIENT_ID.env.localOAuth client ID for GitHub login flow — No GITHUB_APP_CLIENT_SECRET.env.localOAuth client secret — No GITHUB_APP_PRIVATE_KEY.env.localRSA private key (PEM format, newlines as \n) — No GITHUB_WEBHOOK_SECRETConvex Dashboard HMAC secret for GitHub webhook signature validation — No
Generate the webhook secret with:
Variable Where Purpose Default Required SANDBOX_WORKER_URLConvex Dashboard Cloudflare sandbox worker URL http://127.0.0.1:8788 (local)No SANDBOX_API_SECRETConvex Dashboard + Wrangler Shared secret between Convex and sandbox worker — No
Variable Where Purpose Default Required ATLASSIAN_CLIENT_ID.env.local + WranglerAtlassian OAuth client ID — No ATLASSIAN_CLIENT_SECRET.env.local + WranglerAtlassian OAuth client secret — No ATLASSIAN_OAUTH_REDIRECT_URI.env.local + WranglerOAuth callback URL http://localhost:3000/api/atlassian/callbackNo ATLASSIAN_WEBHOOK_SECRETConvex Dashboard HMAC secret for Atlassian webhook signature validation — No ATLASSIAN_TOKEN_ENCRYPTION_KEYConvex Dashboard AES-256 key for OAuth token storage (base64, 32 bytes) — No
Generate the encryption key with:
Variable Where Purpose Default Required DEEPGRAM_API_KEYConvex Dashboard Speech-to-text transcription — No TWELVELABS_API_KEYConvex Dashboard Video understanding and analysis — No ELEVENLABS_API_KEYConvex Dashboard Audio transcription (Scribe v2) — No
Variable Where Purpose Default Required STRIPE_SECRET_KEYConvex Dashboard Stripe API key for billing operations — No STRIPE_WEBHOOK_SECRETConvex Dashboard Stripe webhook signature verification — No
Variable Where Purpose Default Required GOOGLE_CLIENT_ID.env.localGoogle OAuth client ID for Drive import — No GOOGLE_CLIENT_SECRET.env.localGoogle OAuth client secret — No
Variable Where Purpose Default Required FOUNDRY_AUTH_PROVIDER.env.localAuth mode: clerk (multi-tenant) or simple (single-tenant) clerkNo FOUNDRY_ADMIN_EMAIL.env.localAdmin email (simple auth only) — No FOUNDRY_ADMIN_PASSWORD.env.localAdmin password (simple auth only) — No
The smallest set of variables to get Foundry running locally:
NEXT_PUBLIC_CONVEX_URL = https://your-deployment.convex.cloud
CONVEX_DEPLOYMENT = dev:your-deployment
NEXT_PUBLIC_CONVEX_SITE_URL = https://your-deployment.convex.site
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY = pk_test_...
CLERK_SECRET_KEY = sk_test_...
CLERK_JWT_ISSUER_DOMAIN = https://your-domain.clerk.accounts.dev
AGENT_SERVICE_URL = http://localhost:3001
Plus in the Convex Dashboard :
ANTHROPIC_API_KEY=sk-ant-...
Everything else is optional and enables specific integrations as you need them.