Next.js Discord

Discord Forum

how does @next/env work?

Unanswered
gosip posted this in #help-forum
Open in Discord
i want to access environment variables that doesn't have the prefix NEXT_PUBLIC_ so I started reading [this](https://nextjs.org/docs/pages/guides/environment-variables#loading-environment-variables-with-nextenv) which lead me to make several questions... they point out to make a file called envConfig.ts and then import stuff from there, is this filename locked? or can i use another one? how does it work? does the package run on runtime or at build time?

2 Replies

Pacific sand lance
looks like an example to me
you can use any name, just import valid file later