What’s the Difference Between Sitecore Cloud SDK and Engage SDK?
A breakdown of features, use cases, pros, and limitations for each SDK.
Start typing to search...
Although both the Sitecore Cloud SDK and the Sitecore Engage SDK are tools made to help developers work inside the Sitecore ecosystem, they have different functions and are made for various parts of the platform. Both support the collection and usage of data within Sitecore CDP and both are integral in enabling Sitecore Personalize on a website.
They are also at different stages of their own development so functionality will most likely change in coming months and years. I foresee more updates to Cloud SDK given its closer integration with XM Cloud, than that of Engage. But before we get too far along, let's examine their distinctions, applications, specifications, and constraints.
With a focus on headless solutions, the Sitecore Cloud SDK is a robust development toolkit created to simplify interfaces with Sitecore's XM Cloud services. With the help of cutting-edge frameworks like Next.js, it enables developers to create, administer, and implement scaled digital experiences with ease. The Cloud SDK streamlines the complexity of headless architecture with integrated support for content delivery, personalization, and smooth integration with cloud-hosted environments like Vercel and Netlify, freeing up teams to concentrate on creating dynamic and captivating user experiences.
There are several key features of Cloud SDK that stand out.
The requirements to use Cloud SDK are a bit restrictive. You will require:
Firstly, this is if you want to run them programmatically. You can still run these entirely within Sitecore Personalize Web Experiences.
Install the Personalize Package:
Ensure that the @sitecore-cloudsdk/personalize package is installed in your project:
bash
Copy code
npm install @sitecore-cloudsdk/personalize
Initialize the Personalize Module:
Import and initialize the personalize module in your application, providing necessary configuration such as your Sitecore Edge Context ID and site name.
import { init } from '@sitecore-cloudsdk/personalize/browser';
const initPersonalize = async () => {
await init({
sitecoreEdgeContextId: '<YOUR_CONTEXT_ID>',
siteName: '<YOUR_SITE_NAME>',
enableBrowserCookie: true,
});
console.log('Initialized the personalize/browser module.');
};
initPersonalize();
Run the Personalize Experience:
Utilize the personalize function to execute a specific experience by providing its friendly ID, along with other parameters like channel and currency.
import { personalize } from '@sitecore-cloudsdk/personalize/browser';
const runPersonalizeExperience = async () => {
const response = await personalize({
friendlyId: '<YOUR_EXPERIENCE_FRIENDLY_ID>',
channel: 'WEB',
currency: 'USD',
});
console.log('Personalize experience response:', response);
// Implement logic to display personalized content based on the response
};
runPersonalizeExperience();
In order to facilitate smooth interaction with customer data and sophisticated personalization capabilities, the Sitecore Engage SDK was created especially for developers working with Sitecore Personalize and the Customer Data Platform (CDP). It gives teams the ability to create intricate client journeys, apply dynamic audience segmentation, and distribute customized content across many touchpoints. With its powerful tools for consumer insights, behavior analytics, and real-time event tracking, the Engage SDK assists companies in developing highly customized experiences that increase engagement and cultivate enduring client loyalty.
To run an interactive experience or experiment, you can use the Engage.personalize(personalizationData[, timeout]) function provided by the Engage SDK. This function requires the friendlyId of the live experience or experiment you wish to execute. Here’s an example:
import { engage } from "./engage.js";
const runPersonalization = async () => {
const personalizationData = {
channel: "WEB",
currency: "USD",
pointOfSale: "myretailsite/usa",
friendlyId: "your_experience_friendly_id",
// optional attributes
params: {
key: "value"
}
};
try {
const response = await engage.personalize(personalizationData);
console.log(response);
// Based on the response data, you can implement additional personalization here
} catch (error) {
console.error("Personalization failed:", error);
}
};
runPersonalization();
Parameters:
personalizationData: An object containing event and experiment data, including the friendlyId of the experience or experiment.timeout (optional): The number of milliseconds before the function times out and returns an error.Considerations:
friendlyId can be found in the Sitecore Personalize interface under the experience or experiment details.Engage.personalize() function is specifically for running interactive full-stack experiences or experiments.Unlike Engage SDK, the Sitecore Cloud SDK supports page personalization and component A/B/n testing within JSS Next.js applications hosted on XM Cloud. This functionality is facilitated through the XM Cloud add-on, which integrates Next.js applications with XM Cloud's personalization and testing features.
By utilizing the Sitecore Cloud SDK in conjunction with the XM Cloud add-on, you can effectively implement page personalization and component A/B/n testing to enhance user engagement and optimize content performance.
The ability to develop and test several iterations (variants) of individual components on a webpage in order to ascertain which one works best with your audience is known as component A/B/n testing. This approach focuses on smaller, reusable website building parts, including banners, call-to-actions, hero sections, or product cards, rather than testing complete pages. The objective is to minimize development overhead while optimizing particular aspects of the user experience.
How it works:
Targeting and Audience Segmentation:
Using Next.js Middleware for rendering:
Tracking and Gathering Metrics:
Analyzing the Results and Making Decisions: