Month: April 2025

Setup XM Cloud Site to host on Vercel

In this blog post we will Link the XM Cloud to Vercel. The XM Cloud site will be hosted in Vercel by Seting up the host

In this blog post we saw how to setup the Vercel Project manually but this whole process can be automated by Creating and linking the host.

Configure Hosting Connection

Login to XM Cloud and navigate to Connections –> Hosting tab

Click on Create connection –> Vercel

Login to Vercel and add Integration

Select the account to connect. In my case its personal account

Select the all projects to integrate, dont selecy any specific project or you will get error. See errors section-

Confirm and Add Integration-

A new Hosting connection is created with the name-

Setup Hosting

Navigate to Projects ==> Environments ==> Sites Tab

Link Vercel Site (Connection been already created)

You can create Hosting connection from here too.

Click “Create and link”

Now you can see the Site is linked to host i.e. Vercel.

Once the Site is linked you should be able to see the project in Vercel

Login to vercel and see the newly created project and deployment in-progress.

In few minutes the deployment should be completed

Click on the domains and should see the Site-

Errors-

Vercel installation will require ‘All Projects’ access. Please change the access on the Vercel installation

Resolution

Delete any exisitng Hosting Connection and re-create the hosting with Integration to be allowed to all projects.

Loading

Use Experience Edge GraphQL to access XM Cloud hosted site

GraphQL delivery API is used to access the published site content. Experience Edge for Experience Manager (XM) is an API-based service from Sitecore that gives you globally replicated, scalable access to your XM Cloud items, layout, and media. You can use the standard publish tools in XM Cloud , but instead of rendering content from a self-hosted Content Delivery environment, Experience Edge provides you a Sitecore-hosted GraphQL API. 

To access the XM Cloud hosted published site content using Expereince Edge follow these steps-

Login to XM Cloud. Navigate to Projects ==> Environments ==>Details tab.

Launch IDE for Live GraphQL

The URL for GraphQL IDE –

https://edge.sitecorecloud.io/api/graphql/ide

GraphQL edge endpoint is –

https://edge.sitecorecloud.io/api/graphql/v1

Let stry a simple query to get siteinfo-

If you see this error- JSON.parse: unexpected character at line 1 column 1 of the JSON data

This means a header with GraphQL token is not provided or incorrect.

Generate Delivery API token-

Add X_GQL-TOKEN in header with newly generated token vlaue

You should now be able to access only the published Site content using Experience Edge.

If you are not able to see the items, you might have not published the ietms

Publish items to edge

Loading