DEV Community

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

Collapse
 
davel_x profile image
davel_x

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 : nextjs.org/docs/api-reference/next...

Collapse
 
desilerma25 profile image
Desiree Lerma • 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!

Collapse
 
vladi160 profile image
vladi160

with static export will be client side only.