WHAT YOU'LL LEARN
  • Which event handlers are available for Groups?
  • How to use them?
  • How to load them in your project?

Overview
anchor

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
anchor

GroupBeforeCreateEventHandler
anchor

extensions/cms/group/eventHandler/create/beforeCreate.ts

GroupAfterCreateEventHandler
anchor

extensions/cms/group/eventHandler/create/afterCreate.ts

Update a Group
anchor

GroupBeforeUpdateEventHandler
anchor

extensions/cms/group/eventHandler/update/beforeUpdate.ts

GroupAfterUpdateEventHandler
anchor

extensions/cms/group/eventHandler/update/afterUpdate.ts

Delete a Group
anchor

GroupBeforeDeleteEventHandler
anchor

extensions/cms/group/eventHandler/delete/beforeDelete.ts

GroupAfterDeleteEventHandler
anchor

extensions/cms/group/eventHandler/delete/afterDelete.ts

Loading Event Handlers in Your Project
anchor

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