The Events feature allows decoupled parts of the CMS to:

  1. Notify the rest of the system that something has happened, and
  2. React to things that happen elsewhere in the system.


interface Events {
  dispatch(event: Event): void
  subscribe(eventType: string, listener: Listener): Unsubscribe

interface Event {
  type: string
  // Any other data may be added to the event.
  [key: string]: any

type Listener = (event: Event) => void

type Unsubscribe = () => void


Dispatching Events{
  type: 'something-happened',

Subscribing to Events

The function can be used to start listening for certain events., event => {
  // ...

The EVENT_NAME is a string that matches a pattern for the event name.

Checkout the tests for specific examples of how the matching happens.

Log all Events'*', event => {

Log when a Form Plugin is added"plugins:add:form", (event) => {
  console.log(`Added a Form called "${}"`

Log all Form Events'plugins:*:form', event => {
  console.log(`Something happened to the form plugins`)

Log all Plugin Events'plugins', event => {
  console.log(`Something happened to the plugins`)

Note that the string pluginsis equivalent to plugins:* or plugins:*:*.

Existing Events


cms:enabledThe CMS has been enabled.
cms:disabledThe CMS has been disabled
sidebar:openedThe Sidebar has been opened
sidebar:closedThe Sidebar has been closed.
plugin:add:{__type}A Plugin of a given __type has been added.
plugin:remove:{__type}A Plugin of a given __type has been removed.


Event NameDecription
github:errorAn error has occurred when making requests to the GitHub API.
github:branch:checkoutThe current branch has been switched.
github:branch:createA new branch has been created.