Closed dzuluaga closed 1 month ago
Hey @dzuluaga,
I think this is outside of the scope of this project/library as we leave it to the users how they provide secret values to their applications. When it comes to our sample app we are already using react-native-dotenv
and following one of the techniques mentioned in the library (https://www.npmjs.com/package/react-native-dotenv#processenv-technique).
Thanks @Esemesek. I've recloned the repo and can't repro the issue. I see there's a commit in flight by Andrei. Will keep an eye on it.
Hey @dzuluaga, thanks for bringing this to our attention! This has been addressed and should be fixed in https://github.com/openmobilehub/react-native-omh-auth/pull/63/commits/63a16f4e5f70226c352d1ba765f25ff359f0e633.
We have also improved the documentation in https://github.com/openmobilehub/react-native-omh-auth/commit/788538f588d0099ea2ea7ae923ae7007afeae273, so developers won't need necessarily to store their secrets in a .env file, leaving it up to them to decided how to pass those values to our API.
I've been encountering intermittent issues with accessing environment variables using
process.env
in my React Native project. Despite having variables set in the.env
file, the application does not recognize them and throws errors.Observation: It seems that
process.env
is not the most reliable method for accessing environment variables in React Native. This method often leads to issues, possibly due to caching or other environment-specific reasons.Proposed Solution: I switched to using
@env
from thereact-native-dotenv
package and found it to be a more idiomatic and reliable approach. This change resolved all issues related to accessing environment variables.Recommendation: Consider adopting the
@env
approach fromreact-native-dotenv
for handling environment variables. It aligns better with React Native’s ecosystem and improves reliability.Thank you for considering this suggestion.