Skip to main content

config

Tool to access environment variables.

Submit feedback
github
import { config } from '@uhg-abyss/web/tools/config';

Dev env config example

** Note: Abyss App Starter-Kit Only **

In the example below we are running the config tool in the dev environment. Running config without passing it a value will return the available config including the global variables and environment specific variables. The config method also can accept a variable name and returns it's value.

Environment variables

Below is a standard setup for the environment config. Read more about Abyss environment configurations here.

{
"env": {
// Global variables
"APP_NAME": "Create Abyss App - Micro Frontend"
},
"env.dev": {
// Env specific variables
"ENV_VAR": "dev-only"
},
"env.test": {
"ENV_VAR": "test-only"
},
"env.stage": {
"ENV_VAR": "stage-only"
},
"env.prod": {
"ENV_VAR": "prod-only"
}
}

Config

Example config uses:

const allConfigVariables = config();
// {
// APP_NAME: 'Create Abyss App - Micro Frontend',
// ENV_VAR: 'dev-only',
// }
const appName = config('APP_NAME');
// "Create Abyss App - Micro Frontend"
const appEnv = config('ENV_VAR');
// "dev-only"
Table of Contents