When developing an app or component, we often need to use different types of resources depending on the application phase we are working on.

For instance, we’ll need a different setup either for development or production stage, where needed resources or variables can differ in each of the working environments, such as API URLs, domain names, and so on.

web-coding.png

Dev environment

quiz.png

Test environment

product.png

Prod environment

Therefore, to get this to workaround we make use of the System library for us being able to set up the different environments (dev, test, and prod) containing the needed resources for our application.

Why set up environment variables?

As all of our app information will depend on which environment we are in, it’s easier for the development process to set up a global configuration of the application itself containing all the related variables it will consume.

For example, let’s say we need different domain names for each of the environments we are working on in an app. The fact that we use a configuration file for the whole application helps us save time as we are only affecting that file when we need some new changes.

Installation and usage: @oasis/system

Follow the link to learn more about how to install and use the System library.

Installation and usage Oasis System