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",
    },
    ],
    ],
    };
    };

ความคิดเห็น • 8

  • @ИванГулак-с3р
    @ИванГулак-с3р 18 วันที่ผ่านมา

    react-native-dotenv doesn't work with expo. I am stuck on expo welcome screen after using react-native-dotenv.

    • @technerd3455
      @technerd3455 17 วันที่ผ่านมา

      i am stuck on the same issue ... any update ??

  • @dbuuCollege
    @dbuuCollege 9 วันที่ผ่านมา

    not working in expo in development build

    • @CodeMender
      @CodeMender  5 วันที่ผ่านมา +1

      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.

  • @2K22B16JosephKurianJohn
    @2K22B16JosephKurianJohn 6 หลายเดือนก่อน +1

    helped me a lot , thank you

    • @CodeMender
      @CodeMender  6 หลายเดือนก่อน

      Glad to hear that!

  • @AftabShaik-r4z
    @AftabShaik-r4z 2 หลายเดือนก่อน

    for production eas build the env is not getting load

    • @CodeMender
      @CodeMender  2 หลายเดือนก่อน

      Check the name of the env variable it should start with EXPO.