Environment
Environment Variable Files
- You can make any number of environment variables in the root of the main SAFER
for IOS and SAFER for Android repo. The default, and recommended is:
.env
Specifying the Variables
To specify the variable, within your environment file simply put the variable name followed by an equals and the value:
Example:
EXPO_PUBLIC_LOG_LEVEL=INFO
OTHER_VARIABLE=VAL
Configurable Variables
| Variable | Required | Values | Default |
|---|---|---|---|
| EXPO_PUBLIC_LOG_LEVEL | Optional | INFO/DEBUG/WARN/ERROR | ERROR |
| EXPO_PUBLIC_DEBUG | Optional | true/false | false |
| YOUR_GOOGLE_MAPS_API_KEY | Android Builds | API key | |
| EXPO_PUBLIC_GOOGLE_PLACES_API_KEY | Required | API key |
EXPO_PUBLIC_LOG_LEVEL
This controls the logging level that the application keeps track of. There are 4 different levels:
- ERROR
- WARN
- DEBUG
- INFO
If none are specified, it will default to ERROR. All higher log levels will also log those below it, i.e. if your log level is “INFO” everything will be logged; But if your log level is “WARN”, only WARN and ERROR will be logged.
EXPO_PUBLIC_DEBUG
When true the debug screen will appear on the bottom. Default is false.
YOUR_GOOGLE_MAPS_API_KEY
The google maps api key that is used for the project. This is required for android builds as they make use of the Google Maps API for Precaching.
EXPO_PUBLIC_GOOGLE_PLACES_API_KEY
The google places api key that is used for the project. This can be the same as the google maps api key, however, this one cannot be restricted as it is accessed like a website with no header. Therefore it must be an unrestricted api key.