Posts

Showing posts from May, 2024

Steps to Generate Access Token for Authoring API Endpoint in XM Cloud

Image
Hello everyone, In this blog we will understand, how to get access token which is must for interacting with Authoring API endpoint. As we all know, to work with preview endpoint in XM Cloud, we required sc_apikey which we can get from Sitecore. But we cannot use the same when working with Authoring API endpoint. We will require an access token for the same. So follow below steps to implement the same. Step 1 : Login to you XM Cloud Instance and click on XM Cloud Deploy APP. Step 2 : Click on Credentials in left side panel. Step 3 : Click on Create Credentials.A popup will come up. Fill the details as shown in below figure. Step 4 : Another popup will come up which will show you generated client id and client secret.Copy you client secret as will not be accessible once popup us closed. Step 5 : Now we are ready with client id and client secret. It's time to get the access token.Open Powershell in administrator mode and run below command.The placeholder {0} represent the clie...

Understanding Search Query With Pagination Using GraphQL In XM Cloud

Image
Hello Everyone, In this blog we will see how we can implement search query using GraphQL and implement pagination.GraphQL uses cursor based system to handle pagination whenever we execute a search query. We will see this in action. Let's understand this with a common use-case which every developers encounters. We are having Blog pages or Article pages. We want to get all blogs or articles based on some conditions. The blogs or articles should be sorted based on published date. At first, we just want to show n number of items from the result. Then on load more, we need to show the remaining items. Let's jump quickly into action. We will open GraphQL IDE and dive into writing the query. I am using local XM Cloud. Required thing to execute query. GraphQL IDE : "https://xmcloudcm.localhost/sitecore/api/graph/edge/ide" Api Key: We can get it from Sitecore instance under mentioned path. Path: /sitecore/system/Settings/Services/API Keys. In above image, it give...

Understanding External Component in Content Hub with Use Case Using React

Image
Hello everyone, In this blog we will see how we can create external component using react in Sitecore Content Hub. In one of my old blogs, I have created a similar component using Knockout JS. We will consider the same use case to build this component but using React. Before starting our blog, I will highly encourage you to read my old blog here . Creating external component, assigning the component to Asset Details page, making it visible on the page will be exactly same as we have done in the old blog. The changes what we are going to do in Content Hub, I will add the screenshot below. Before developing the component in react, we need to setup our React front end solution. I would highly recommened to watch the youtube tutorial for setting up the front end solution here . Adding few helpful command below which is required during setup. I will provide all reference link below in reference section. // For creating new react project using Vite npm create vite@latest //Quic...