Skip to content
'; user_status_content.firstChild.appendChild(avatarContainer); } else { // Placeholder for LoggedOutUserMenu let loggedOutContainer = document.createElement('div'); // if LoggedOutUserMenu fallback let userBtn = document.createElement('button'); userBtn.style.width = "33px"; userBtn.style.height = "33px"; userBtn.style.display = "flex"; userBtn.style.alignItems = "center"; userBtn.style.justifyContent = "center"; userBtn.style.color = "var(--ds-gray-900)"; userBtn.style.border = "1px solid var(--ds-gray-300)"; userBtn.style.borderRadius = "100%"; userBtn.style.cursor = "pointer"; userBtn.style.background = "transparent"; userBtn.style.padding = "0"; // user icon ( from geist) let svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); svg.setAttribute('data-testid', 'geist-icon'); svg.setAttribute('height', '16'); svg.setAttribute('stroke-linejoin', 'round'); svg.setAttribute('style', 'color:currentColor'); svg.setAttribute('viewBox', '0 0 16 16'); svg.setAttribute('width', '16'); let path = document.createElementNS('http://www.w3.org/2000/svg', 'path'); path.setAttribute('fill-rule', 'evenodd'); path.setAttribute('clip-rule', 'evenodd'); path.setAttribute('d', 'M7.75 0C5.95507 0 4.5 1.45507 4.5 3.25V3.75C4.5 5.54493 5.95507 7 7.75 7H8.25C10.0449 7 11.5 5.54493 11.5 3.75V3.25C11.5 1.45507 10.0449 0 8.25 0H7.75ZM6 3.25C6 2.2835 6.7835 1.5 7.75 1.5H8.25C9.2165 1.5 10 2.2835 10 3.25V3.75C10 4.7165 9.2165 5.5 8.25 5.5H7.75C6.7835 5.5 6 4.7165 6 3.75V3.25ZM2.5 14.5V13.1709C3.31958 11.5377 4.99308 10.5 6.82945 10.5H9.17055C11.0069 10.5 12.6804 11.5377 13.5 13.1709V14.5H2.5ZM6.82945 9C4.35483 9 2.10604 10.4388 1.06903 12.6857L1 12.8353V13V15.25V16H1.75H14.25H15V15.25V13V12.8353L14.931 12.6857C13.894 10.4388 11.6452 9 9.17055 9H6.82945Z'); path.setAttribute('fill', 'currentColor'); svg.appendChild(path); userBtn.appendChild(svg); loggedOutContainer.appendChild(userBtn); loggedOutContainer.style.display = 'flex'; loggedOutContainer.style.gap = '8px'; loggedOutContainer.style.alignItems = 'center'; user_status_content.firstChild.appendChild(loggedOutContainer); } })();
Menu
 

Managing microfrontends

Last updated March 26, 2026

With a project's Microfrontends settings of the Vercel dashboard, you can:

You can also use the Vercel Toolbar to manage microfrontends.

You can add a project to a microfrontends group using the CLI or the dashboard.

Using the CLI:

Run the following command from the project directory and follow the interactive prompts:

terminal
vercel microfrontends add-to-group

To pre-fill the group and default route, pass them as flags. A billing confirmation prompt will still be required:

terminal
vercel mf add-to-group --group="My Group" --default-route=/docs

Using the dashboard:

  1. Visit the Settings tab for the project that you would like to add.
  2. Click on the Microfrontends tab.
  3. Find the microfrontends group that it is being added to and click Add to Group.

These changes will take effect on the next deployment.

Add the current project to a microfrontends group.
Add the current project to a microfrontends group.

You can remove a project from a microfrontends group using the CLI or the dashboard. Make sure no other microfrontend refers to this project before removing it.

Using the CLI:

Run the following command from the project directory and follow the interactive prompts:

terminal
vercel microfrontends remove-from-group

After removal, update microfrontends.json in the default application to remove the project's entry. The CLI will warn you if the project is still referenced in the configuration but will not block the removal.

Using the dashboard:

  1. Remove the microfrontend from the microfrontends.json in the default application.
  2. Visit the Settings tab for the project that you would like to remove.
  3. Click on the Microfrontends tab.
  4. Find the microfrontends group that the project is a part of. Click Remove from Group to remove it from the group.

These changes will take effect on the next deployment.

Projects that are the default application for the microfrontends group can only be removed after all other projects in the group have been removed.

This action is not reversible.

Using the CLI:

Run the following command and follow the interactive prompts. The CLI will show how many projects will be removed but does not require the group to be empty first:

terminal
vercel microfrontends delete-group

To pre-select the group, pass it as a flag. A confirmation prompt will still be required:

terminal
vercel mf delete-group --group="My Group"

Using the dashboard:

Remove all projects from the group first, then the option to delete the group becomes available in the group's settings.

This setting only applies to preview and custom environments. Requests for the production environment are always routed to the production deployment for each microfrontend project.

When microfrontend projects are not built for a commit in preview or custom environments, Vercel will route those requests to a specified fallback so that requests in the entire microfrontends group will continue to work. This allows developers to build and test a single microfrontend without having to build other microfrontends.

There are three options for the fallback environment setting:

  • Same Environment - Requests to microfrontends not built for that commit will fall back to a deployment for the other microfrontend project in the same environment.
    • For example, in the Preview environment, requests to a microfrontend that was not built for that commit would fallback to the Preview environment of that other microfrontend. If in a custom environment, the request would instead fallback to the custom environment with the same name in the other microfrontend project.
    • When this setting is used, Vercel will generate Preview deployments on the production branch for each microfrontend project automatically.
  • Production - Requests to microfrontends not built for this commit will fall back to the promoted Production deployment for that other microfrontend project.
  • A specific custom environment - Requests to microfrontends not built for this commit will fall back to a deployment in a custom environment with the specified name.

This table illustrates the different fallback scenarios that could arise:

Current EnvironmentFallback EnvironmentIf Microfrontend Built for CommitIf Microfrontend Did Not Build for Commit
PreviewSame EnvironmentPreviewPreview
PreviewProductionPreviewProduction
Previewstaging Custom EnvironmentPreviewstaging Custom Environment
staging Custom EnvironmentSame Environmentstaging Custom Environmentstaging Custom Environment
staging Custom EnvironmentProductionstaging Custom EnvironmentProduction
staging Custom Environmentstaging Custom Environmentstaging Custom Environmentstaging Custom Environment

If the current environment is Production, requests will always be routed to the Production environment of the other project.

If using the Same Environment or Custom Environment options, you may need to make sure that those environments have a deployment to fall back to. For example, if using the Custom Environment option, each project in the microfrontends group will need to have a Custom Environment with the specified name. If environments are not configured correctly, you may see a MICROFRONTENDS_MISSING_FALLBACK_ERROR on the request.

To configure this setting, visit the Settings tab for the microfrontends group and configure the Fallback Environment setting.

If your project has a project domain assigned to a Git branch, and the fallback environment is set to Same Environment, deployments on that branch will use the branch's project domain as the fallback environment instead of the production branch (e.g. main).

To use that branch across the microfrontends group, add a project domain for the branch to every project in the group.

To share settings between Vercel microfrontend projects, you can use the Vercel Terraform Provider to synchronize across projects.

Shared Environment Variables allow you to manage a single secret and share it across multiple projects seamlessly.

To use environment variables with the same name but different values for different project groups, you can create a shared environment variable with a unique identifier (e.g., FLAG_SECRET_X). Then, map it to the desired variable (e.g., FLAG_SECRET=$FLAG_SECRET_X) in your .env file or build command.

This feature is currently only supported for Next.js.

Navigations between different top level microfrontends will introduce a hard navigation for users. Vercel optimizes these navigations by automatically prefetching and prerendering these links to minimize any user-visible latency.

To get started, add the PrefetchCrossZoneLinks element to your layout.tsx or layout.jsx file in all your microfrontend applications:

app/layout.tsx
import {
  PrefetchCrossZoneLinks,
  PrefetchCrossZoneLinksProvider,
} from '@vercel/microfrontends/next/client';
 
export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        <PrefetchCrossZoneLinksProvider>
          {children}
        </PrefetchCrossZoneLinksProvider>
        <PrefetchCrossZoneLinks />
      </body>
    </html>
  );
}

Then in all microfrontends, use the Link component from @vercel/microfrontends/next/client anywhere you would use a normal link to automatically use the prefetching and prerendering optimizations.

import { Link } from '@vercel/microfrontends/next/client';
 
export function MyComponent() {
  return (
    <>
      <Link href="/docs">Docs</Link>
    </>
  );
}

When using this feature, all paths from the microfrontends.json file will be visible on the client side. This information is used to know which microfrontend each link comes from in order to apply prefetching and prerendering.

By default, observability data from Speed Insights and Analytics is routed to the default application. You can view this data in the Speed Insights and Analytics tabs of the Vercel project for the microfrontends group's default application.

Microfrontends also provides an option to route a project's own observability data directly to that Vercel project's page.

  1. Ensure your Speed Insights and Analytics package dependencies are up to date. For this feature to work:
    • @vercel/speed-insights (if using) must be at version 1.2.0 or newer
    • @vercel/analytics (if using) must be at version 1.5.0 or newer
  2. Visit the Settings tab for the project that you would like to change data routing.
  3. Click on the Microfrontends tab.
  4. Search for the Observability Routing setting.
  5. Enable the setting to route the project's data to the project. Disable the setting to route the project's data to the default application.
  6. The setting will go into effect for the project's next production deployment.

Enabling or disabling this feature will not move existing data between the default application and the individual project. Historical data will remain in place.

If you are using Turborepo with --env-mode=strict, you need to either add ROUTE_OBSERVABILITY_TO_THIS_PROJECT and NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH to the allowed env variables or set --env-mode to loose. See documentation for more information.


Was this helpful?

supported.