Docs

Environment Variables

Reference for all environment variables, where each one belongs, and what it does.

Convoy uses environment variables across three different contexts. Each variable belongs in a specific place — setting it in the wrong place has no effect.

Where Each Variable Goes

VariableConvex DashboardWeb Hosting (Vercel, etc.)Local .env.local
CLERK_JWT_ISSUER_DOMAINYes——
RESEND_API_KEYYes——
EMAIL_FROMYes——
NEXT_PUBLIC_APP_URLYes——
CONVOY_BACKEND_BUILD_IDYes——
CONVOY_BACKEND_BUILD_TIMEYes——
CONVOY_BACKEND_GIT_REFYes——
CONVOY_BACKEND_VERCEL_ENVYes——
CONVEX_DEPLOY_KEY—Yes (if integrated build)—
NEXT_PUBLIC_CONVEX_URL—Yes (if separate deploy)Yes
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY—YesYes
CLERK_SECRET_KEY—YesYes
NEXT_PUBLIC_CLERK_SIGN_IN_URL—YesYes
NEXT_PUBLIC_CLERK_SIGN_UP_URL—YesYes
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL—YesYes
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL—YesYes
NEXT_PUBLIC_APP_ENV—YesYes
NEXT_PUBLIC_APP_BUILD_ID—YesYes
NEXT_PUBLIC_APP_BUILD_TIME—YesYes
NEXT_PUBLIC_APP_GIT_REF—YesYes
NEXT_PUBLIC_APP_VERCEL_ENV—YesYes
NEXT_PUBLIC_APP_VERSION_POLL_INTERVAL_MS—YesYes
NEXT_PUBLIC_VERCEL_ANALYTICS_ENABLED—YesYes
CONVEX_DEPLOYMENT——Yes

Convex Dashboard Variables

Set these in the Convex dashboard under Settings → Environment Variables for your deployment. They run inside Convex functions at runtime.

VariableRequiredPurpose
CLERK_JWT_ISSUER_DOMAINYesClerk JWT issuer domain for token verification
RESEND_API_KEYNoResend API key for transactional email
EMAIL_FROMNoVerified sender identity (e.g. Convoy <noreply@example.com>)
NEXT_PUBLIC_APP_URLNoBase URL for email links. Defaults to https://app.convoy.build when unset
CONVOY_BACKEND_BUILD_IDNoBackend build or commit id shown in Settings → Developer. Vercel integrated builds should set this from VERCEL_GIT_COMMIT_SHA before convex deploy
CONVOY_BACKEND_BUILD_TIMENoBackend deploy timestamp shown in Settings → Developer
CONVOY_BACKEND_GIT_REFNoBackend branch/ref shown in Settings → Developer
CONVOY_BACKEND_VERCEL_ENVNoVercel environment label shown for the backend in Settings → Developer

Web Hosting Variables

Set these in your web hosting provider (Vercel, Cloudflare, etc.). They are used by the Next.js app at build time and runtime.

VariableRequiredPurpose
CONVEX_DEPLOY_KEYIf integrated buildDeploy key for CI/CD Convex deploys (Settings → General → Deploy Keys)
NEXT_PUBLIC_CONVEX_URLIf separate deployConvex deployment URL (e.g. https://friendly-wolf-872.convex.cloud)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYYesClerk publishable key for browser auth
CLERK_SECRET_KEYYesClerk server-side secret
NEXT_PUBLIC_CLERK_SIGN_IN_URLYesSign-in route (typically /auth/sign-in)
NEXT_PUBLIC_CLERK_SIGN_UP_URLYesSign-up route (typically /auth/sign-up)
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URLYesPost-sign-in redirect (typically /auth/callback)
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URLYesPost-sign-up redirect (typically /auth/callback)
NEXT_PUBLIC_APP_ENVNoEnvironment label (dev, staging, or production). Non-production values show a colored indicator card in the sidebar. Defaults to production
NEXT_PUBLIC_APP_BUILD_IDNoFrontend build or commit id shown in Settings → Developer. Vercel builds derive this from VERCEL_GIT_COMMIT_SHA when unset
NEXT_PUBLIC_APP_BUILD_TIMENoFrontend build timestamp shown in Settings → Developer. The Next.js build fills this automatically when unset
NEXT_PUBLIC_APP_GIT_REFNoFrontend branch/ref shown in Settings → Developer. Vercel builds derive this from VERCEL_GIT_COMMIT_REF when unset
NEXT_PUBLIC_APP_VERCEL_ENVNoFrontend Vercel environment label shown in Settings → Developer. Vercel builds derive this from VERCEL_ENV when unset
NEXT_PUBLIC_APP_VERSION_POLL_INTERVAL_MSNoFrontend update-check interval in milliseconds. Defaults to 120000 (2 minutes)
NEXT_PUBLIC_VERCEL_ANALYTICS_ENABLEDNoEnables Vercel Web Analytics only when set to true. Defaults to off so self-hosted installs do not send analytics events to Vercel unless explicitly opted in

When using the integrated Convex build command, the NEXT_PUBLIC_CONVEX_URL is injected automatically and does not need to be set separately. See Deploy to Vercel for the full command, including backend version metadata setup.

Convex Deploy Variables

These are used on the command line or in CI when deploying Convex functions. They are not set in the Convex dashboard or in your web hosting provider.

VariablePurpose
CONVEX_DEPLOYMENTTarget deployment with prefix: prod: for production, dev: for development (e.g. prod:friendly-wolf-872)
CONVEX_DEPLOY_KEYDeploy key from the Convex dashboard (Settings → General → Deploy Keys). Includes auth — useful for CI/CD

Use one or the other. See Deploy the Convex Backend for usage examples.

Local Development

For local development, apps/web/.env.local only needs:

NEXT_PUBLIC_APP_ENV=dev
NEXT_PUBLIC_APP_VERSION_POLL_INTERVAL_MS=120000
NEXT_PUBLIC_VERCEL_ANALYTICS_ENABLED=false

CONVEX_DEPLOYMENT=dev:your-dev-deployment-123
NEXT_PUBLIC_CONVEX_URL=https://your-dev-deployment-123.convex.cloud

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...

NEXT_PUBLIC_CLERK_SIGN_IN_URL=/auth/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/auth/sign-up
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/auth/callback
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/auth/callback

The dev: prefix indicates a development deployment. Production deployments use prod: instead.

Convex server-side variables (CLERK_JWT_ISSUER_DOMAIN, RESEND_API_KEY, EMAIL_FROM, NEXT_PUBLIC_APP_URL) go in the Convex dashboard for your dev deployment — they are not needed in .env.local.

Guidance

  • Keep secrets out of the repo
  • Make Convex NEXT_PUBLIC_APP_URL match the real user-facing URL when you need email links to target a non-default host
  • Verify that the Convex deployment URL matches the environment users are actually signing into
  • Convex dashboard env vars and Next.js env vars serve different runtimes — configure both

On this page