A
Alokaiajaykrmahato

Fetch .env variables in .vue files

Hello everyone , I am trying to fetch an .env variable in "modules/checkout/components/VsfPaymentProvider.vue" but "process.env.SOME_KEY" is not working for me , which is the default way to access env in .vue files .
S
skirianov326d ago
Hi 👋 This is a Nuxt.js thing and I couldn’t find anything in their docs, but take a look at this answer it may help https://stackoverflow.com/a/67705541
Stack Overflow
How to use .env variables in Nuxt 2 or 3?
I have .env file in the project root, and in my nuxt config I am using variables to configure ReCaptcha like this: import dotenv from 'dotenv' dotenv.config() export default { modules: [ ...
A
ajaykrmahato326d ago
Thanks , I will have a look into this .