Environment

This details how to configure your environment, and the variables that are configurable

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

VariableRequiredValuesDefault
EXPO_PUBLIC_LOG_LEVELOptionalINFO/DEBUG/WARN/ERRORERROR
EXPO_PUBLIC_DEBUGOptionaltrue/falsefalse
YOUR_GOOGLE_MAPS_API_KEYAndroid BuildsAPI key
EXPO_PUBLIC_GOOGLE_PLACES_API_KEYRequiredAPI key

EXPO_PUBLIC_LOG_LEVEL

This controls the logging level that the application keeps track of. There are 4 different levels:

  1. ERROR
  2. WARN
  3. DEBUG
  4. 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.