Description
react-native-config brings 12-factor style configuration to React Native apps, so you can keep config variables in a .env file and read them in your JavaScript code. It supports iOS, Android, macOS and Windows. You create a .env file in the root of the app and access the variables from code, and on native code you can read them too. The readme warns that the library does not obfuscate or encrypt secrets, so sensitive keys should not be stored in the .env file, since mobile app secrets can be reverse engineered. Setup is an npm install followed by a native rebuild. On React Native 0.60 and later the library is autolinked, and on iOS and macOS you install the pod first. The readme warns against linking it manually on those versions, and it provides manual steps only for older React Native and react-native-windows versions. The latest version is tested with React Native 0.87 and the New Architecture, and version 1.6.0 and later need React Native 0.74 or higher. The readme includes a TypeScript declaration for the .env file and troubleshooting notes. It also asks for support through Open Collective sponsorship, since the library needs ongoing maintenance.…
Highlights
- Config variables from a .env file
- iOS, Android, macOS and Windows support
- Autolinked on React Native 0.60 and later
- TypeScript declarations for variables
- Works with the New Architecture
Ratings & Reviews
No ratings yet
Be the first to rate React Native Config.
People also visit
React Native Config FAQ
What does react-native-config do?
It lets a React Native app read config variables from a .env file, following 12-factor practices.
Should I put secrets in .env?
No. The readme says the library does not obfuscate or encrypt secrets, and mobile app secrets can be reverse engineered.
How do I install it?
Install it from npm, then rebuild the app. On React Native 0.60 and later it is autolinked, and on iOS you install the pod first.
Which React Native version does it need?
Version 1.6.0 and later need React Native 0.74 or higher, according to the readme.
Does it support Windows?
Yes. The readme says it works with react-native-windows, with autolinking from version 0.63.
How is it supported?
The readme asks for sponsorship on Open Collective to fund the maintenance work.
What are the best React Native Config alternatives?
Popular alternatives to React Native Config include React Native Sensitive Info, Arkana and React Native Inappbrowser. See all React Native Config alternatives
















