#will preview env use production env vars?

1 messages · Page 1 of 1 (latest)

worn vigil
#

will preview env use production env vars?

unique rootBOT
#

Hi @worn vigil. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources provided, preview deployments in Convex do not use production environment variables by default. Here's what you need to know:

  1. Preview deployments create a fresh Convex backend for each preview, separate from your production and development deployments Preview Deployments (https://docs.convex.dev/production/hosting/vercel#preview-deployments).

  2. If your app depends on certain Convex environment variables, you can set up default environment variables for preview and development deployments in your project Preview Deployments (https://docs.convex.dev/production/hosting/vercel#preview-deployments).

  3. For preview deployments, you typically need to set up a separate CONVEX_DEPLOY_KEY environment variable specifically for previews Preview Deployments (https://docs.convex.dev/production/hosting/vercel#preview-deployments).

  4. If you want to use specific environment variables for preview deployments, you can set them up in your project settings or deployment configuration. For example, in Vercel, you can set environment variables specifically for preview deployments Preview Deployments (https://docs.convex.dev/production/hosting/vercel#preview-deployments).

  5. It's worth noting that preview deployments run against fresh Convex backends, which do not share data with development or production Convex deployments Preview Deployments (https://docs.convex.dev/production/hosting/netlify#deploy-previews).

In summary, preview environments do not automatically use production environment variables. You need to set up environment variables specifically for preview deployments if you want them to have access to certain configuration values.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: