# Configuring your Sitecore Heads in Vercel for Multi-site

- URL: https://davegoosem.com/blog/configuring-your-sitecore-heads-in-vercel-for-multi-site
- Author: David Goosem, Technical Architect
- Published: 2023-08-24
- Tags: Sitecore, JSS, Headless, CI/CD, Vercel
- Reading time: 2 min

> Managing multiple heads means you have multiple env variable files and need to have environment-specific values for a lot of these as you move between environments. Let's also assume you want to have 3 seperate environments on top of your own local development environment

## Solution Structure

If you haven't already, have a quick read of this post which covers one of the ways we can utilise multi-headed multi-site with Sitecore.

![Multi-headed JSS Site diagram](https://davegoosem.com/static/images/posts/2023/configuring-your-sitecore-heads-in-vercel-for-multi-site/image.png 'Multi-headed JSS Site diagram')

Let's assume we have 3-4 seperate heads and a shared site to manage the shared components/logic and you now want to configure Vercel to manage this nicely for you.

Managing multiple heads means you have multiple env variable files and need to have environment-specific values for a lot of these as you move between environments.

Let's also assume you want to have 3 seperate environments on top of your own local development environment:

- Dev/QA Environment
- UAT/Pre-Prod Environment
- Production Environment

To support this, from a Vercel standpoint we're using GitOps which means that each env is tracking a different Git Branch.

We are going to use a branching strategy and GitOps mapping as follows:

- `develop` branch - standard working branch which new work feature branches are derived from. Dev/QA Vercel environment will track this branch.

- `uat` branch - Vercel UAT environment branch - merges to this branch will trigger releases to all heads tracking it

- `master` branch - Production branch. Merges to this branch will deploy changes to production.

## Vercel Shared Environment Variables

If you have lots of heads but you're sharing some capabilities between them, there might be some environment variables you wish to share between all the heads. You can do this via the main team level settings shown below.

![Vercel Env Variables](https://davegoosem.com/static/images/posts/2023/configuring-your-sitecore-heads-in-vercel-for-multi-site/image-1.png 'Vercel Env Variables')

## App-specific Environment Variables

For each Head, you will then be able to configure Production/Preview and Development environments. The way we generally opt to manage this is to use Production as Production (shock horror) and then depending how many non-prod environments we have set up Preview on <i>branch x</i>

For our example we have Preview on `uat` for UAT and then Preview on `develop` for our Dev/QA.

Simply punch in all the environment values against the correct environment/branch combination and that's it.

![Vercel Env Variables app specific](https://davegoosem.com/static/images/posts/2023/configuring-your-sitecore-heads-in-vercel-for-multi-site/image-2.png 'Vercel Env Variables app specific')

Add the shared variables you want to use in each head like so:

![Vercel Env Variables add shared](https://davegoosem.com/static/images/posts/2023/configuring-your-sitecore-heads-in-vercel-for-multi-site/image-3.png 'Vercel Env Variables add shared')

![Vercel Env Variables add shared 2](https://davegoosem.com/static/images/posts/2023/configuring-your-sitecore-heads-in-vercel-for-multi-site/image-4.png 'Vercel Env Variables add shared 2')
