Skip to content
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

Configure .env for environment variables #5

Open
jmiranda opened this issue May 24, 2021 · 1 comment
Open

Configure .env for environment variables #5

jmiranda opened this issue May 24, 2021 · 1 comment

Comments

@jmiranda
Copy link
Member

Details
https://docs.expo.io/guides/environment-variables/

Expected Behaviors

  • Should be used for any environment (development, staging, production) to store environment variables that will be used for API URLs, keys, secrets, etc.
  • Should not store .env file in repository (need to figure out way to copy variables to compiled application without leaking secrets)
@Bluesir9
Copy link
Collaborator

Bluesir9 commented Jun 3, 2021

react-native-dotenv is the standard way to manage environment variables in react-native apps. However it doesn't seem to be playing well with Expo.

So for now an Environment.ts configuration object has been added to the project. Environment.ts just defines the shape of the environment configuration and the developer running the project is expected to provide the actual configuration in a file called EnvironmentActual.ts file that exports the actual object. Since this configuration can change from developer to developer, the file has been excluded from the repo.

While for now this will be good enough, we should consider revisiting how react-native-dotenv can be made to work sometime in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants