Home > Back-end >  How to access the environment variables in Amazon S3 for the react application as I have stored the
How to access the environment variables in Amazon S3 for the react application as I have stored the

Time:12-04

REACT_APP_API_KEY=** REACT_APP_FIREBASE_API_KEY=**

Using in the below style in react js for local environment : process.env.REACT_APP_FIREBASE_API_KEY

Note : I am using aws code pipeline and code build for ci /cd.

CodePudding user response:

In Code Build you can edit the Environment and add environmental variables. Click Additional configuration in the console to see it. You can export REACT_APP_FIREBASE_API_KEY there and you it should be picked up by npm run build.

You could also use an .env.production file and commit it to source code. These aren't secrets, are added to the deployed code, so there shouldn't be a security issue.

  • Related