if process.env doesn't works by changing in config. Use const VITE_YOUR_API_KEY = import.meta.env.VITE_YOUR_API_KEY Use the VITE_ for successfull configuration with Vite support. Add VITE_YOUR_API_KEY in .env and use it fearlessly with the import.