Skip to content

Dotenv Env #297

Closed Answered by yjose
Holymaiden asked this question in Q&A
Discussion options

You must be logged in to vote

dotenv can't be used in React Native during runtime and should only be used at build time. This is precisely what we are doing with the project structure. If you check carefully, we are importing the env.js only in app.config.ts, as this will be used by Expo while generating the project (build time). To use those environment variables in the src project(runtime), we pass all those environment variables as extras in app.config.ts and then export them in src/core/env.js. make sure to read the guide for more details

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yjose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants