Ariel Mejia
December 11th, 2022 - 1 min read
Let's imagine that our .env
file has this value
VITE_API_PUBLIC_KEY=123
Then in your Javascript component or any frontend file you can get the value as
console.log(import.meta.env.VITE_API_PUBLIC_KEY)
Thanks for reading!
Sign up & get tips and tricks
You'll get monthly updates regarding my most recent articles and products.