- Difference between development builds with
expo-dev-client
and Expo Go. - Configuring development and production variants in a managed project.
- Using
.env
files to manage your environment variables.
- Check this video to understand what is the difference between Expo Go and Expo Custom Development Client.
In this challenge we are going to put everything in place that you can have these variants on your app (Dev and production)
Following the documentation to add variants to your application:
- create your
app.config.js
to use in your managed project- add a custom name for your dev app
Let's say now you want to have differents API endpoints. You can use environment variables to do that. Don't forget to follow the .env
convention.
- create a
.env.local
file and add your environment variables.
EXPO_PUBLIC_API_URL=https://swapi.py4e.com/
- use
process.env.EXPO_PUBLIC_API_URL
to call the Star Wars API in your app.
In real situations, you may have multiple enpoints depending on the environment. Here is how you can set differents build profiles.
🔥 Never commit sensitive information!
If you want to store secret key in your repository like SENTRY_API_KEY
, you can use EAS Secrets.
To create a new secret, run :
eas env
eas env:create // create a new secret
eas env:list // view any existing secrets for this project
- use
eas env:create
and create a fakeSWAPI_KEY
because there is no API key for the Star Wars API.
In the next lesson, we are going to build your app and show you how to install it on your phone.
- Check with-env config and update your
app.config
file. - Create new icons with Figma like with-env icons to have a custom icon for your dev app.