Skip to content

Integrations — Vercel routing and microfrontends for Sitecore XM Cloud

Created:
Updated:

Introduction

On many Sitecore XM Cloud projects today, Vercel + Next.js is a no brainer / go to way to ship the front end. What is less obvious is just how much can be actually done with Vercel’s routing layer and microfrontend patterns before we reach for external routing like Azure Front Door or a legacy reverse proxy.

In this post I’ll walk through:

Everything here assumes a typical XM Cloud + Next.js setup (App Router or Pages Router) deployed to Vercel, but the patterns generalize to other React/Vue heads as well.


The two routing patterns I reach for

For an XM Cloud estate with several sites (for example several product or brand sites) and a legacy website or CMS, I keep two routing options in mind.

Vercel as the primary router

Vercel Instance

/business-unit-a, /business-unit-b

/business-unit-c, /business-unit-d

Fallback

DNS: cws.com → Vercel Edge

Vercel Routing Layer (Edge)

Rewrites Configuration (vercel.json)

Next.js Project 1

━━━━━━━

• Business Unit A

• Business Unit B

Next.js Project 2

━━━━━━━

• Business Unit C

• Business Unit D

Legacy/Other CMS

(Legacy)

━━━━━━━

• All other

paths

Sitecore XM Cloud Instance 1

• Business Unit A Site

• Business Unit B Site

Sitecore XM Cloud Instance 2

• Business Unit C Site

• Business Unit D Site

In the “Vercel‑only” pattern, DNS points directly at Vercel’s edge network and Vercel’s routing layer decides which app serves which path.

Key traits of this pattern in my projects:

This is also where Vercel’s official Microfrontends guidance fits best: I can split by path into multiple apps (the “multi‑zones” starter) or use frameworks like single‑spa, while Vercel manages the edge routing.

Azure Front Door (or similar) in front of Vercel

Vercel Instance 2

Vercel Instance 1

Fallback

/business-unit-a, /business-unit-b

/business-unit-c, /business-unit-d

DNS: cws.com → Azure Front Door

Azure Front Door

Routing Rules & Origin Groups

Legacy/Other CMS

(Legacy)

━━━━━━━

• All other

paths

Next.js Project 1

━━━━━━━

• Business Unit A

• Business Unit B

Next.js Project 2

━━━━━━━

• Business Unit C

• Business Unit D

Sitecore XM Cloud Instance 1

• Business Unit A Site

• Business Unit B Site

Sitecore XM Cloud Instance 2

• Business Unit C Site

• Business Unit D Site

In more regulated or multi‑cloud environments, I see teams put Azure Front Door (AFD), Cloudflare, or another global entry point in front of Vercel.

In that setup:

This pattern is useful when:


Configuring routing on Vercel and Azure Front Door

You do not need anything exotic to configure these patterns; they mostly use standard routing features in Vercel and Azure Front Door.

Vercel routing and rewrites

For a Vercel‑only setup:

For the microfrontends examples in this post, the key idea is:

Azure Front Door routes and origins

For the Azure Front Door → Vercel pattern:

Once routes and origins are in place, the pipeline looks like this:


Latency and cost: some concrete numbers

Routing choices are easier when you anchor them in numbers. These examples are illustrative ballparks, not vendor SLAs — always validate with your own tests and pricing calculators.

Network hops and latency

Consider a user in London hitting cws.com:

If your XM Cloud pages are mostly static or ISR and you care about every millisecond on marketing sites, that extra hop matters.
For authenticated portals or heavy API calls, the difference is usually overshadowed by app logic.

Azure Front Door pricing vs Vercel

As of writing, the Azure Front Door pricing page shows (Standard tier):

For a mid‑size XM Cloud estate doing 50 million requests/month and 2 TB egress from Front Door to clients:

On Vercel Pro, pricing is mostly plan‑based:

The actual break‑even point depends heavily on:

Rule of thumb:


Microfrontends on Vercel for XM Cloud

With routing in place, the next question is how to carve the estate into microfrontends.

Vercel’s Microfrontends documentation and templates highlight three useful patterns:

  1. Multi‑zones — split a domain by path into multiple Next.js apps.
  2. Module Federation / build‑time composition — share components across apps, often via Turborepo.
  3. Framework‑agnostic shells — compose React, Vite, or single‑spa apps in the browser.

XM Cloud works well with all three.

Path‑based microfrontends with Multi‑Zones

Multi‑zones is the simplest pattern and tends to be my default for XM Cloud:

Benefits:

This corresponds directly to the Next.js Multi‑Zones Starter template that Vercel publishes for microfrontends.

Component‑level microfrontends

Sometimes you want to go finer‑grained than “one app per path”. For example:

In those cases you can:

Vercel is agnostic here: you deploy each app as usual; the composition is handled by your build config or runtime framework.
From an XM Cloud perspective, the important part is that:

Cross‑stack microfrontends (multiple CMSs, multiple stacks)

One of the more powerful patterns is to mix stacks and CMSs under one domain:

Vercel’s routing and microfrontends story allows you to:

When Vercel is the main edge router, you configure:

If Azure Front Door sits in front, it will route by top‑level path and hostname to the right Vercel or non‑Vercel origin, and Vercel handles the microfrontends for the origins it owns.


Monorepos and independent deployments

Microfrontends are much easier to manage in a monorepo with clearly separated apps and shared packages.

A typical structure for an XM Cloud estate might look like:

apps/
  marketing-brand-a/
  marketing-brand-b/
  marketing-brand-c/
  marketing-brand-d/
  account-portal/
packages/
  ui/
  design-tokens/
  xm-cloud-content/
  analytics/

Patterns that work well here:

Deployment behavior:

From XM Cloud’s point of view, each app is just another consumer of Experience Edge; serialization and SCS workflows stay in your XM Cloud repo(s) and pipelines.


Serving multiple independent projects and CMSs

The real strength of this approach is that you can serve multiple independent projects from a single monorepo and even multiple CMSs and stacks under one domain.

Examples I see in practice:

  1. XM Cloud multi‑tenant estate

    • apps/marketing-brand-a talks to an XM Cloud instance dedicated to Brand A.
    • apps/marketing-brand-b talks to an XM Cloud instance dedicated to Brand B.
    • Each has its own SCS project and item tree.
    • Both share a ui library and some layout patterns, but deploy independently.
  2. XM Cloud + Content Hub + third‑party CMS

    • /products/** is served by a Next.js app hitting Content Hub GraphQL directly (no sync), as described in the Content Hub GraphQL post.
    • /stories/** is served by an XM Cloud‑backed marketing app.
    • /help/** is a docs app backed by a separate headless CMS.
    • Routing between them is handled purely at the edge (Vercel or AFD).
  3. Next.js + non‑Next stacks

    • /portal/** is a React SPA deployed as a static export to Vercel or as a separate origin behind Front Door.
    • /config/** is a small Hono or Nitro microservice deployed as a backend microfrontend (as in Vercel’s SaaS microservices template).
    • Everything still appears as a single coherent site from the user’s point of view.

Because each microfrontend is its own deployable app, you can:


CI/CD for XM Cloud microfrontends

The last piece is wiring CI/CD so teams can move fast without breaking routing or content.

Vercel‑centric pipeline

For apps deployed to Vercel:

For XM Cloud:

In this setup:

Azure‑centric pipeline with Front Door

If Azure Front Door is the primary entry point:

This pattern is slightly more complex but gives you:


When to choose which routing pattern

To decide between “Vercel‑only” and “Azure Front Door → Vercel”, I would ask:

In both cases, I tend to lean towards microfrontends with:


Practical recommendations for XM Cloud teams

If you are planning or refactoring an XM Cloud estate with Vercel:

Done well, this gives you:



Previous Post
Integrations — Reviewing XM Cloud / Next.jspull requests with coding agents safely
Next Post
AI Code Generation — From prompt to XM Cloud component matrix