Using server-side JavaScript in Sitecore Personalize

Abstract

Describes how and where you can use server-side JavaScript in the Sitecore Personalize application.

Sitecore Personalize supports both client-side and server-side JavaScript, depending on the feature that you are using. This topic identifies which features use server-side JavaScript, and the supported JavaScript functionality and functions. You can also use client-side JavaScript in the Sitecore Personalize application.

Server-side JavaScript (SSJS) is an extended version of JavaScript that enables back-end access to systems and servers. Sitecore Personalize can run server-side JavaScript when running programmable decisions in Sitecore Personalize decisioning. Sitecore Personalize can also run SSJS when generating real-time audiences in experiments.

Sitecore Personalize supports modern JavaScript on the server-side, meaning the JavaScript EcmaScript (ES) 6 syntax. However, not all ES6 functions are supported due to the employed JavaScript transpiler.

Running SSJS enables you to access back-end systems, services, and servers. This means you can use guest attributes and their history, as well as a continuous stream of real-time session data. The internal Guest Context Service generates the guest attributes on the server-side.