[Plugin events]

Plugins may add new controllers and actions to Kuzzle's API. These do not differ from native controllers/actions and these, too, trigger events that can be listened by plugins.

EventTypeDescriptionPayload
<pluginName>/<controller>:after<Action>PipeTriggered after the action action of the controller controller added by the plugin pluginName has completedType: Request
<pluginName>/<controller>:before<Action>PipeTriggered before the action action of the controller controller added by the plugin pluginName has startedType: Request
<pluginName>/<controller>:error<Action>PipeWhen an error occurred during an action in controller controller, an event error is triggeredType: Request

Example:

The plugin foo adds a controller named fooController, containing an action named fooAction.

When an API request invokes this new API route, Kuzzle will automatically trigger the following events:

  • foo/fooController:beforeFooAction (before the request starts)
  • foo/fooController:afterFooAction (after the request completes)

And in case of error, will trigger the event:

  • foo/fooController:errorFooAction