You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if it helps but I was using VueJS and realized you can use fs when bootstrapping the system. For my case placing this logic in the vue.config.js (Or a webpack.config.js for example) solved that error.
Though not entirely sure this is what we need as it still shows up in the compiled js defeating the purpose of the encryption...More debugging I'm sure.
Hi @kunalpanchal ,
I'm using your npm package with react js application. it is not working properly.
I followed the below steps,
Installed it locally like :
In package.json it looks like:
Created .env file in the root directory and added below key values
CLIENT_ID=1234
API_KEY=4455
My current npm version is :
It is greater than v5.2, so I ran the below command.
npx secure-env .env -s SecretkeyHelloWorld
After that it is created env.enc file. and I deleted .env file to prevent stealing.
I have added below lines in index.js,
let secureEnv = require('secure-env');
global.env = secureEnv({secret:'SecretkeyHelloWorld'});
When I hover on packages it shows some warning message:
I start the application using below command
npm start
The env variables is displaying as undefined:
I also tried REACT_APP as prefix in .env file, still it's not working.
REACT_APP_CLIENT_ID=1234
REACT_APP_API_KEY=4455
Please let me know if I've missed out anything.
The text was updated successfully, but these errors were encountered: