1,544 questions
How to access Next.js environment variables in a deployed environment?
Billy Brown Kano Dekou
20
Reputation points
Question: I am currently running a Next.js frontend on localhost:3000. I have set the environment variables API_BASE_URL, CLIENT_ID and CLIENT_SECRET in my .env.local file, and I am able to access them on my local server. However, when I deploy to production, the base URL is being overwritten by the production environment, even though I declared the environment variables in Azure before deploying. How can I access my environment variables in a deployed environment?
Windows for business Windows Client for IT Pros Devices and deployment Set up, install, or upgrade
Sign in to answer