React Native Expo: Adding Environment Variables with .env Files
ฝัง
- เผยแพร่เมื่อ 1 ต.ค. 2024
- In this tutorial, discover the essential steps to fortify your React Native Expo projects by seamlessly incorporating environment variables using .env files. Safeguard your sensitive information and elevate your app's security. Follow along as we walk you through the process, ensuring a smooth integration that enhances both functionality and privacy. Upgrade your Expo skills today! 🔒🚀
@CodeMender #reactnative #expo #axios #enviromentvariable
npm i react-native-dotenv
Babel.config.js:
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
[
"module:react-native-dotenv",
{
moduleName: "@env",
path: ".env",
},
],
],
};
};
react-native-dotenv doesn't work with expo. I am stuck on expo welcome screen after using react-native-dotenv.
i am stuck on the same issue ... any update ??
not working in expo in development build
th-cam.com/video/qVRLR37EurA/w-d-xo.htmlsi=2Tsah89CHCWr3JPQ
@dbuuCollege you need to include them in the eas.json file for it to function correctly. Check out the video linked above for guidance.
helped me a lot , thank you
Glad to hear that!
for production eas build the env is not getting load
Check the name of the env variable it should start with EXPO.