JS Modules
JS Modules are reusable pieces of code that technical users create within Sitecore Personalize, enabling users to easily import reusable functions into programmables when working with decision models. JS modules can be used only in programmables within decision models and aren't supported in conditions.
JS Modules simplify development in the following ways:
-
Enabling reuse of code functions throughout the application. You create the code once, then publish it to enable its usage in the Personalize app.
-
Accelerating development with a built-in coding canvas that includes syntax validation, field auto-complete based on your data model, a data model picker, and support for the moment.js library for timestamp formatting.
-
Validating - when you save your code, the Personalize app checks JavaScript syntax, format, and compatibility with the JS engine.
-
Allowing you to view all code dependencies in one centralized location and efficiently manage any changes to existing functionality.