$npx -y skills add datahub-project/datahub-skills --skill datahub-mfe-configure-appConfigure a DataHub instance to load and display a Micro Frontend (MFE) app. Use when the user wants to register an MFE with DataHub, add an MFE to the nav sidebar, set up MFE config for local dev or production/k8s, or troubleshoot MFE loading issues.
| 1 | # Configure an MFE in DataHub |
| 2 | |
| 3 | Walks through registering a Micro Frontend app with the DataHub frontend so it |
| 4 | loads at `/mfe/<path>` and optionally appears in the navigation sidebar. Covers |
| 5 | local development, production/k8s deployment, and troubleshooting. |
| 6 | |
| 7 | ## Step 1: Gather Information |
| 8 | |
| 9 | Use the **AskQuestion** tool to collect the following in a single call. |
| 10 | |
| 11 | | Question | ID | Options | |
| 12 | | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 13 | | Are you configuring for local development or production/k8s? | `env_target` | `Local development` / `Production / Kubernetes` | |
| 14 | | MFE app name — the `name` field inside `new ModuleFederationPlugin({ name: '...' })` in the MFE's `webpack.config.js`. **Must match exactly.** | `mf_name` | `testAppMFE` / `N/A - I'll fill it in later` | |
| 15 | | URL path where the MFE should be accessible, e.g. `/dashboard` (must start with `/`) | `mfe_path` | `/test_page` / `N/A - I'll fill it in later` | |
| 16 | | `remoteEntry.js` URL, e.g. `http://localhost:3002/remoteEntry.js` | `remote_entry_url` | `http://localhost:3002/remoteEntry.js` / `N/A - I'll fill it in later` | |
| 17 | | Display label for navigation, e.g. `Team Dashboard` | `display_label` | `Test Dashboard` / `N/A - I'll fill it in later` | |
| 18 | | Should the MFE appear in the left nav sidebar? | `show_in_nav` | `Yes` / `No` | |
| 19 | | Nav icon | `nav_icon` | `ChartBar` / `Trophy` / `Gear` / `HandWaving` / `Lightning` / `MagnifyingGlass` / `Database` / `Users` / `Shield` / `Bell` / `Flag` / `Star` / `Heart` / `Cube` / `Table` / `Code` / `Globe` / `Rocket` | |
| 20 | |
| 21 | If `env_target` is **Local development**, ask one follow-up question using |
| 22 | **AskQuestion** before proceeding: |
| 23 | |
| 24 | | Question | ID | Options | |
| 25 | | ------------------------------------ | ------------ | ------------------------------------------------------------------------------ | |
| 26 | | How are you running DataHub locally? | `local_mode` | `Docker / datahub-dev.sh (standard)` / `Play server directly (sbt / IntelliJ)` | |
| 27 | |
| 28 | For the `N/A - I'll fill it in later` fields (`mf_name`, `mfe_path`, |
| 29 | `remote_entry_url`, `display_label`), do NOT invent or suggest values from the |
| 30 | workspace. The user will type their own. |
| 31 | |
| 32 | > **Finding the MFE app name**: Open the MFE's `webpack.config.js` and look for |
| 33 | > the `ModuleFederationPlugin` block. The `name` property is what goes here: |
| 34 | > |
| 35 | > ```js |
| 36 | > new ModuleFederationPlugin({ name: 'teamDashboardMFE', ... }) |
| 37 | > // ^^^^^^^ |