npm installin the SitecoreDXG Generation Service's installation directory.
registerTriggerfunction. This function is required, and has the job of performing the registration logic that binds the ID of the trigger to the function that should be called in order to start listening and executing the generation, which in this case is the
TRIGGER_IDproperty does not actually need to be made public via
exports, but it is a good practice to do so anyway.
[SitecoreDXG-Generation-Service-Installation-Directory]/plugins/triggersfolder and copy in your custom trigger file. SitecoreDXG will dynamically load all files in this folder as triggers. Note that it is recommended that you add your trigger file into a sub-directory of the
triggers/MyTrigger, for better organization.
npm initand then add the third-party modules to the package's dependencies. This will help keep your custom trigger more self-contained and modular, while avoiding the need to make changes to the SitecoreDXG Generation Service's native package.json
[SitecoreDXG-Generation-Service-Installation-Directory]/settings.jsfile and in the
configurationobject update the value of the
Triggerproperty to the ID of your custom trigger. This will tell SitecoreDXG that your custom trigger is the one that should be registered and used.
npm installin either the SitecoreDXG Generation Service root or in the trigger's root to install the dependencies