#How to properly do .env with vite and netlify?
1 messages · Page 1 of 1 (latest)
Yes, use import.meta.env.VITE_SOME_KEY in your code. You have to prepend each variable with VITE if you want it bundled in client code. If server side, use process.env.SOME_KEY. To use the variables in netlify it is exactly like your screen shot. It has to use the same variable name and same value for that variable to work.