Using Environment Variables in Next.JS application

4 months ago23k times

Environment Variables can be used with the following code.

Environment Variable

NEXT_PUBLIC_HOSTING_VARAIBLE=localhost

to access the environment variable in Component

process.env.NEXT_PUBLIC_HOSTING_VARAIBLE


Add Answer

Add a codeAdd Code
Remove adsremove

Latest Snippets

view all