PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 21, 2022

[FIXED] How to access the environment variables in Amazon S3 for the react application as I have stored the Firebase and Google Api Key in env variables?

 August 21, 2022     amazon-s3, cicd, environment-variables, reactjs     No comments   

Issue

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.


Solution

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.



Answered By - kgiannakakis
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing