Manage JS modules
The JS modules page allows you to view and manage all your reusable JS modules in one central location. You open the JS modules library by clicking Developer center > JS modules. Search for the module by name or ID, or use one of the filters to narrow down the list of modules.
Team members with a User, Developer, or Admin role in Sitecore Cloud Portal can manage JS modules.
Check module usage
To help you manage your JS modules, you can check the usage of a published module within the app. This can be useful to debug functionality, or remove a module from a programmable decision if need be.
To check a module's usage:
-
From the JS modules page, open the module.
-
On the Usage pane, you can see the number of places in which the module is reused.
-
To see a detailed list of where the JS module is used, click View list.
-
In the Module usage dialog, to open a place where the module is used, such as a programmable decision, click
.
Duplicate a module
You can duplicate a module to copy its code, description and tags to a new module. This is useful when the module is being used within the application and you want to modify and test it before publishing it for reuse.
To duplicate a module:
-
From the JS modules page, open the module you want to duplicate.
-
Click Duplicate.
-
In the Name your new module field, enter a new name for the JS module
-
Click Create.
Delete a module
You can delete a module that is not used anywhere within the Personalize application. If you attempt to delete a module that is in use, a message displays that includes the places within the app where the module is used.
To delete a module that is in use, you must first remove it from everywhere it is used:
-
From the JS modules page, open the module you want to delete.
-
Click
> Delete. -
In the confirmation dialog, click View where this is used.
-
Click
adjacent to the programmable that uses the JS module. This navigates to the the decision canvas. -
Click
icon to open the programmable. -
Click the
icon and deselect the JS module to clear the module's checkbox to disable its use within this programmable decision.
To delete an unused module:
-
From the JS modules page, open the module you want to delete.
-
Click
> Delete. -
In the confirmation dialog, click Delete.