# aio-lib-env **Repository Path**: mirrors_adobe/aio-lib-env ## Basic Information - **Project Name**: aio-lib-env - **Description**: Helper library that is to be used in the Adobe I/O CLI and SDKs to determine the environment to run in, whether prod, or stage. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-11 - **Last Updated**: 2026-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Version](https://img.shields.io/npm/v/@adobe/aio-lib-env.svg)](https://npmjs.org/package/@adobe/aio-lib-env) [![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-env.svg)](https://npmjs.org/package/@adobe/aio-lib-env) ![Node.js CI](https://github.com/adobe/aio-lib-env/workflows/Node.js%20CI/badge.svg) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-env/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-env/) # Adobe I/O Env Lib This is a helper library that is to be used in the Adobe I/O CLI and SDKs to determine the environment to run in, whether `prod`, or `stage`. ### Installing ```bash $ npm install @adobe/aio-lib-env ``` ### Usage Determining the Environment ```javascript const { getCliEnv, /* function */ setCliEnv, /* function */ SUPPORTED_ENVS, /* array */ DEFAULT_ENV, /* string */ PROD_ENV, /* string */ STAGE_ENV /* string */ } = require('@adobe/aio-lib-env') // getCliEnv defaults to PROD_ENV if the global config key is not set, or is set to an unknown env const env = getCliEnv() // do something based on the env - switch to prod or stage endpoints, for example ``` Setting the Environment (.aio) ```json { cli: { env: "prod" } } ``` Setting the Environment (.env) ```ini AIO_CLI_ENV=prod ``` Setting the Environment (in code) ```javascript const { setCliEnv, PROD_ENV, STAGE_ENV } = require('@adobe/aio-lib-env') setCliEnv(PROD_ENV) setCliEnv(STAGE_ENV) setCliEnv('delta-quadrant') // throws Error ``` ### Debug Logs ```bash LOG_LEVEL=debug ``` Prepend the `LOG_LEVEL` environment variable and `debug` value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls. ### Contributing Contributions are welcome! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information. ### Licensing This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.