Posts

Showing posts from February, 2023

How to connect Nextjs app with XM Cloud using Graphql

Image
We have a Nextjs app with sxastarter template. Please find the below GitHub repo for the solution. https://github.com/sitecorelabs/xmcloud-foundation-head-staging Clone the repo into your local disk.  Note: This repo is a docker-based solution but we don't need to install any docker-related packages. Open the folder in visual studio code for admin mode.  Navigate to the Nextjs app source using the below command:      PS C:\xm-cloud> cd src/sxastarter Open the .env.local file and update the following fields. .env.local is a copy of the .env file and overrides the updated settings and it's ignored by .gitignore for local. Need to Update : SITECORE_API_KEY=   D732E23E-A7A6-4E4E-87B8-A68B88D51612 Get the key value from your Sitecore path. which is required to authenticate and identify the connections.   /sitecore/system/Settings/Services/API Keys - here find the item Id and remove the curly braces JSS_APP_NAME ="NextApp" If " JSS_APP_NAME" is ...