Environment Variables Not Accessible in v0

I’m experiencing an issue where custom environment variables configured in v0 Project Settings are not accessible in my application code, despite appearing correctly in the integration dashboard.

Issue Details:

  • Supabase Integration: NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY are configured but return undefined when accessed via process.env in client-side code
  • OpenAI Integration: OPENAI_API_KEY is configured but inaccessible in API routes (/app/api/redesign/route.ts)

What I’ve Tried:

  • Verified variables are properly set in Project Settings → Environment Variables
  • Removed and re-added environment variables multiple times
  • Tried multiple access methods: process.env.VARIABLE_NAME, globalThis.process?.env, etc.
  • Added debugging that shows only Vercel system variables are available: NODE_ENV, VERCEL_URL, VERCEL_REGION, etc.
1 Like

I’m having the same issue! I’m trying to get Claude.ai to fix this, and it’s such a bug! One test revealed that the environment variables were being truncated, then Claude hardcoded nearly all my environment variables to fix the issue and leaked all my keys. I’m still trying to fix this thing, and I’ll update accordingly.

-Matt