Problem Statement
What prefix makes environment variables accessible in the browser in Next.js?
Explanation
Environment variables prefixed with NEXT_PUBLIC_ are exposed to the browser and can be accessed in client-side code using process.env.NEXT_PUBLIC_VARIABLE_NAME, while variables without this prefix remain server-only for security. Next.js inlines these public variables at build time replacing them with their values, so they become part of your JavaScript bundle. Never put secrets like API keys or database credentials in NEXT_PUBLIC_ variables as they'll be visible to anyone inspecting your frontend code, and use server-only variables for sensitive data accessed through API routes or Server Components.
