Headless CMS
Group Event Handlers
Which event handlers are available in Headless CMS Groups and how to use them.
WHAT YOU'LL LEARN
- Which event handlers are available for Groups?
- How to use them?
- How to load them in your project?
Overview
Webiny Headless CMS provides events for users to hook into.
With the events you can hook into a number of different Group related operations, all of which are listed here.
Create a Group
GroupBeforeCreateEventHandler
extensions/cms/group/eventHandler/create/beforeCreate.ts
GroupAfterCreateEventHandler
extensions/cms/group/eventHandler/create/afterCreate.ts
Update a Group
GroupBeforeUpdateEventHandler
extensions/cms/group/eventHandler/update/beforeUpdate.ts
GroupAfterUpdateEventHandler
extensions/cms/group/eventHandler/update/afterUpdate.ts
Delete a Group
GroupBeforeDeleteEventHandler
extensions/cms/group/eventHandler/delete/beforeDelete.ts
GroupAfterDeleteEventHandler
extensions/cms/group/eventHandler/delete/afterDelete.ts
Loading Event Handlers in Your Project
All the event handlers MUST be exported as default export from the file, otherwise it will not work.
To load the event handlers in your project, you need to add them in the root webiny.config.tsx file, like this:
webiny.config.tsx