The browser cannot read a server-only variable
Next.js does not expose non-public environment variables to browser code.
- Do not add NEXT_PUBLIC_ to a secret. Move the read to an API route, route handler, server component, or backend service.
- Confirm the failing code is really running in the browser.