SvelteKit env vars: which import do I use, and why is mine undefined?
Summary As of November 2026, current SvelteKit docs use variables declared in src/env.ts and imported from $app/env/private or $app/env/public. Variables default to private and dynamic; browser exposure needs public: true, build-time inlining needs static: true. Begin with defineEnvVars.
Not for Nuxt runtimeConfig.
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 sveltekit-env-variables-static-vs-dynamic-public-prefix-or-explicit-env-ts and help me try it