DEV Community

Discussion on: What I Learned This Week: Next.js and API Keys

davel_x profile image

You said "I wanted this projet to be frontend only" but if you're using the API directory of nextjs it's not frontend only anymore, isn't it ? :)

Be aware that theses env vars are hard coded at build. If you want to build your app once with the possibility to be deployed on different servers with different env vars (ex. one build for production and pre-production) you can use the Runtime Configuration :

desilerma25 profile image
Desiree Lerma Author • Edited

Yup! It is in fact what I “wanted” but that isn’t what ended up happening. I see I worded it funky in the blog. Thanks for the tip!

vladi160 profile image

with static export will be client side only.