857 B
857 B
Environment variables
Currently we have 2 types of environment variables:
- Statically injected build time variables
- Dynamic env variables injected via
window
Static env variables
The environment variables are embedded during the build time. Since our app is based on Create React App that produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime.
Static env variables name should always start with REACT_APP_
Dynamic env variables
Dynamic env variables in our cases are injected into app by nginx
<script language="javascript" \>
window.TRACKING_STRATEGY = "$TRACKING_STRATEGY";
window.FULLSTORY = "$FULLSTORY";
window.AIRBYTE_VERSION = "$AIRBYTE_VERSION";
window.API_URL = "$API_URL";
window.IS_DEMO = "$IS_DEMO";
</script>;
later we can use any of the declared variables from window