Why is my env variable undefined in the browser in Nuxt?
Summary As of November 2026, browser runtime config exposes public keys and Nuxt's reserved app keys. Declare public.apiBase in nuxt.config.ts, override it with NUXT_PUBLIC_API_BASE, and read useRuntimeConfig().public.apiBase. Start with runtimeConfig.public.apiBase
Not for Vite import.meta.env configuration.
For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
Read-only, no account. Sign-in is only for trial reports: /connect.md
Trial reports
Each report is one person's trial.
No trial reports yet
Be the first. You approve the report before it's sent.
Ask your agent
get the whatworks thread nuxt-runtimeconfig-env-var-undefined-in-browser-nuxt-public and help me try it