# We really really need some docs on MFE env settings

**URL:** <https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788>\
**Category:** Build-Test-Release\
**Created:** [April 19, 2021, 10:58am UTC](https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788 "2021-04-19T10:58:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [April 19, 2021, 10:58am UTC](https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788/1 "2021-04-19T10:58:14Z")

</div>

Microfrontends (MFE) are about to become officially part of the Open edX Lilac release, scheduled for June 9th. As part of my job as a Tutor maintainer, I am trying to figure out what is the minimal set of common settings to be defined for each MFE, and this is made very difficult by the fact that the _none_ of the MFEs document _any_ of their settings.

For instance, here is the list of env vars for a few MFEs:

- Account: [frontend-app-learning/.env at master · edx/frontend-app-learning · GitHub](https://github.com/edx/frontend-app-learning/blob/master/.env)
- Gradebook: [frontend-app-gradebook/.env at master · edx/frontend-app-gradebook · GitHub](https://github.com/edx/frontend-app-gradebook/blob/master/.env)
- Ecommerce: [frontend-app-ecommerce/.env at master · edx/frontend-app-ecommerce · GitHub](https://github.com/edx/frontend-app-ecommerce/blob/master/.env)
- Payment: [frontend-app-payment/.env at master · edx/frontend-app-payment · GitHub](https://github.com/edx/frontend-app-payment/blob/master/.env)

By looking at these settings lists, I am unable to determine whether I need to define, for instance: `ORDER_HISTORY_URL`, `DISCOVERY_API_BASE_URL`, `SEARCH_CATALOG_URL`. These are just examples of settings for which I have no clear idea whether their values should be shared with other MFEs or not. All I can do is `grep` the repo source code along with my `node_modules/` folder for every one of these settings. This is unmanageable.

As open source maintainers, we need the following:

1. A list of documented settings that are shared between all MFEs. If necessary, this list can be split between [frontend-component-header](https://github.com/edx/frontend-component-header), [frontend-component-footer](https://github.com/edx/frontend-component-footer) and [frontend-platform](https://github.com/edx/frontend-platform).
2. For every MFE, a list of documented settings that are specific to this MFE.

The responsibility of creating these docs belongs to the developers who created the settings and who maintain the MFE repositories, i.e: edX.

I am sorry to raise the alarm in a public forum, but I have asked about this multiple times already in online conversations, both in private and in meetups of the BTR working group. Every time, my request was acknowledged, but not action was taken (as far as I know). With the multiplication of MFE and the Lilac release just around the corner, this documentation effort must be added to the MFE team roadmap as soon as possible.

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [April 19, 2021, 4:34pm UTC](https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788/2 "2021-04-19T16:34:23Z")

</div>

I just stumbled on a tidbit of code that highlights the need of better, standardized MFE settings, even for edX developers. Both the [profile](https://github.com/edx/frontend-app-profile) and the [ecommerce](https://github.com/edx/frontend-app-ecommerce) MFEs depend on the `OPEN_SOURCE_URL` setting, according to their env files:

> <https://github.com/edx/frontend-app-profile/blob/e4b218a47efbecc44724514fd02e0f2714bbcf0f/.env#L27>

> <https://github.com/edx/frontend-app-gradebook/blob/8bc1fc82f2c8e616e33ebb6f47ae7086ee6e3b56/.env#L20>

However, it turns out that this variable is only ever used by the Gradebook MFE, which is totally unrelated to these other two: [https://github.com/search?q=org%3Aedx+OPEN\_SOURCE\_URL&type=code](https://github.com/search?q=org%3Aedx+OPEN_SOURCE_URL&type=code)

---

<div class="post-metadata">

**Author:** ![Maksim\_Sokolskiy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/maksim_sokolskiy/32/8303_2.png) [@Maksim\_Sokolskiy](https://discuss.openedx.org/u/Maksim_Sokolskiy)\
**Post date:** [April 20, 2021, 4:04pm UTC](https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788/3 "2021-04-20T16:04:56Z")

</div>

I can add one more `really` to the title. It’s incredibly inconvenient trying to build and test mfes w/o such documentation.

---

<div class="post-metadata">

**Author:** ![djoy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/djoy/32/542_2.png) [@djoy](https://discuss.openedx.org/u/djoy)\
**Post date:** [April 21, 2021, 3:34pm UTC](https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788/4 "2021-04-21T15:34:18Z")

</div>

I totally hear you on this.

@sarina, I think our team needs a task to document the core environment variables expected to be defined in all MFEs, and then coordinate with other teams to document additional custom variables in MFEs they own. I’m going to go write up a task in FEDX (for now) with some details, and will link it back here.

Update: [[FEDX-566] MFE Environment Variable documentation - JIRA](https://openedx.atlassian.net/browse/FEDX-566)

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [April 21, 2021, 4:01pm UTC](https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788/5 "2021-04-21T16:01:16Z")

</div>

Thanks @djoy I appreciate your response!

---

<div class="post-metadata">

**Author:** ![djoy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/djoy/32/542_2.png) [@djoy](https://discuss.openedx.org/u/djoy)\
**Post date:** [May 18, 2021, 8:32pm UTC](https://discuss.openedx.org/t/we-really-really-need-some-docs-on-mfe-env-settings/4788/6 "2021-05-18T20:32:56Z")

</div>

Hi all,

Following up on this, I’ve merged some documentation for the common variables needed by all MFEs, as well as those used by the header and footer components:

[https://edx.readthedocs.io/projects/edx-developer-docs/en/latest/developers\_guide/micro\_frontends\_in\_open\_edx.html#configuration-with-environment-variables](https://edx.readthedocs.io/projects/edx-developer-docs/en/latest/developers_guide/micro_frontends_in_open_edx.html#configuration-with-environment-variables)

> **[edx/frontend-component-header - Environment Variables](https://github.com/edx/frontend-component-header#environment-variables)**
>
> Contribute to edx/frontend-component-header development by creating an account on GitHub.

> **[edx/frontend-component-footer - Environment Variables](https://github.com/edx/frontend-component-footer#environment-variables)**
>
> Site footer component for edX frontend apps. Contribute to edx/frontend-component-footer development by creating an account on GitHub.

Next I’m planning on adding similar PRs for the MFE-specific environment variables in frontend-app-account, frontend-app-payment, frontend-app-profile, frontend-app-ecommerce, and frontend-app-gradebook.
