.env with Next.js

.env with Next.js

Non-NEXT_PUBLIC_ environment variables are only available in the Node.js environment, meaning in Next.js we use NEXT_PUBLIC_ prifix to the variable will be accessible to client side applications and which do not have will be available for server endpoints.
Here NEXT_PUBLIC_GRAFBASE_API_URL and NEXT_PUBLIC_GRAFBASE_API_Key are used in "use client" files and other in normal server side pages.

For more : https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables

#nextjs #react

To view or add a comment, sign in

Others also viewed

Explore topics