How to access Next.js environment variables in a deployed environment?

Billy Brown Kano Dekou 20 Reputation points
2023-07-26T15:23:48.3933333+00:00

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
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.