How to Create a New Sitecore SXA Headless Site
SXA Headless is easy, awesome and powerful! Learn how to create your first Sitecore Headless Tenant & Site with SXA.
Start typing to search...
SXA Headless is easy, awesome and powerful! Learn how to create your first Sitecore Headless Tenant & Site with SXA.
Headless Sitecore provides a huge improvement over the traditional C# Sitecore approach, which is why XM Cloud has been focused on it as its primary architecture. However, you can also benefit from Headless without being on XM Cloud through Sitecore Experience Accelerator (SXA). In this article, I'm going to walk you through the steps to create your first Sitecore Headless Tenant in SXA to allow you to get started with your Sitecore JSS Experience.
The first step is going into the content editor and accessing the SXA toolbox.
/sitecore/content/ to find your siteYou can add new websites to an existing Tenant or create a new one for each project. Having 2 headless sites under the same tenant will allow the projects to share resources (content/data items/settings/etc…). However, it's common to create a new Tenant for a project with a new codebase to improve organization and keep the projects separated.
If you don't have an existing tenant for your project:
Select "Insert" > "Headless Tenant" from the context menu

Configure Tenant Settings:
Folders: Specify if you want to organize content in virtual or physical folders
physical folder
The physical location of files for the site. The path should be specified as a path relative to Sitecore root.
virtual folder
This prefix is added after the host name definition and is used to resolve sites according to incoming URLs. This is the second attribute, along with the
hostName, which is used to define a unique site.
Next, we want to create our actual Headless Site, which will contain all our content pages and labels for our Frontend Repository.
Right-click and Insert Site: Select "Insert" > " Headless Site" from the context menu

Choose Site Template: Select the "Headless Site" template from the available options
After creating the Headless site, you will need to ensure that you correctly configure all the basic settings for your new Sitecore Site. In the site creation dialog, we can configure the following essential properties:
www.example.com )/sitecore/system/Settings/Services/API KeysAfter creating the site and configuring the basic settings items, we want to start to establish our basic content structure. This can just be a high level outline for now, and you can expand upon it as you start to more robustly develop your site.
/Settings/Site Grouping/{Your Tenant}/{Your Site}Step 6 piggybacks off of Step 5, we can help create a strong Sitecore content architecture by how we build out and define our templates. You will want to think about how you will structure your templates. I recommend using a “modular” approach by creating reusable templates inside the Foundation folder, and applying them to each Page Template directly. This way, you can ensure any templates that have matching fields pull their data from one direct source.
Once our templates are configured, we want to double-check and verify our endpoint configurations. SXA add a new GraphQL endpoint that you can query too, this is very useful for pulling extra data from your Sitecore content tree that isn't returned by default. It also makes sense to look at the RESTful API config’s while you're working on this step.
The next step is to go back to our content tree and try to create some test content to ensure that the Experience Editor (or Sitecore Pages) is working correctly. You can also use this time to check if Sitecore Preview and your local frontend project can correctly connect and pull the data from your Sitecore instance.
The final step is deploying your new local frontend project, we recommend using Vercel for this. Vercel is easy to deploy to and will allow you to utilize zero downtime deployments for your frontend code. If you have configured your Vercel account, you can configure and deploy directly to Vercel by using the Vercel CLI. If you're having trouble connecting your JSS frontend to Sitecore, you can also reference this Sitecore walkthrough that goes over how to do exactly that.
npm i -g vercelLogin to Vercel: Using the Vercel CLI command, vercel login
Console response:
? Log in to Vercel (Use arrow keys)
Continue with GitHub
Continue with GitLab
Continue with Bitbucket
Continue with Email
❯ Continue with SAML Single Sign-On
─────────────────────────────────
Cancel
Create new Project: Using the Vercel CLI run vercel project add {project-name}
You cannot provide any spaces in the project name, and this allows you to have a repo disconnected project created in Vercel
That is the basics of creating a new Sitecore Headless SXA website; however, it's common that you'll come across some issues while you do so. Here are some common items that cause popular issues that you can use to help kickstart your troubleshooting process.