-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Es/mapbox token #1148
base: develop
Are you sure you want to change the base?
Es/mapbox token #1148
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think using something like https://github.com/goatandsheep/react-native-dotenv would notably simplify the implementation as it adheres to the Twelve Factor App approach and also allows usage of shell environment variables (useful for CI like Github + Bitrise).
https://www.npmjs.com/package/react-native-config could also work, but not sure if it allows usage of shell environment variables at build time. not familiar with how to set up an env file for Github Actions and Bitrise but I know both support defining secrets that get injected as shell variables that can be used.
@achou11 I actually have tried this library (and a few other config libraries). None of them work with our current archtecture. Dotenv, doesnt work with our version of babel, and upgrading babel, lead to a whole slew of other issues. I also tried react-native-config and that also didn't work. After playing around with these libraries for several hours, I think the having a prebuild script is the path of least resistance |
ah damn - unfortunate but yeah I guess our react native version is quite behind at this point :/ |
not sure if more convenient but another idea: we already make use of |
@ErikSin was able to get react-native-config working - can push up a separate branch if you're interested in the changes |
yesss please!! |
Created script to generate env variables (to be used by js front end).
updated bitrise.yml to run script in order to access secret key in bitrise