BCMS Events

BCMS Events are JavaScript functions that get triggered by events inside BCMS. They allow you to run some custom code when a specific event happens.

To create simple events that fit into one .ts file, you can follow the instructions below. For more complex events, or when you want to benefit autocomplete, split it into several files, services etc., you can code your events locally.


Adding an event

log in to the BCMS Cloud and open the instance you would like to add an event to. On the instance page click on Events card, then on Add new event button. There you'll be able to provide some information:

  • Event name - Can be any name that you want.
  • Event scope - This can be one of these predefined BCMS event scopes or name of a custom event scope.
  • Method - Defines which method will trigger the event. Can be one of these predefined BCMS event methods.
  • Global scope - Is the place where you want to do your imports and declare utility functions.
  • Handler scope - Is your code that will execute on every event call. Here you have access to: scope, method and payload objects. More information here
Add plugin modal

When you add an event, CMS will rebuild with new configuration. It'll take a few seconds.


Editing an event

When you are on the instance page click on Events card. Here you will see the list of all events with an event name and Edit button next to it. To edit an event, click on Edit button.

When you edit an event, CMS will rebuild with new configuration. It'll take a few seconds.


Deleting an event

When you are on the instance page click on Events card. Here you will see the list of all event with an event name and Edit button next to it. To delete an event, click on Edit button and after that click on Delete button in the bottom left corner of the modal.

When you delete an event, CMS will rebuild with new configuration. It'll take a few seconds.