kuzzle

Is it possible to declare a pipe on an API action of another plugin?


Is it possible from a pipe of an A plugin to interfere with the response of a B plugin?

Use case: I want to use the status cluster route to check the number of nodes in the cluster. Problem is that it displays the IPs of the nodes and I'd like to hide them.


Solution

  • Yes, this can be done using plugin events that Kuzzle creates on top of API routes added by plugins: https://docs.kuzzle.io/core/1/plugins/guides/events/plugin-events/

    These events behave exactly as native API events, the only difference is that Kuzzle prefixes the API controller name with the plugin name to prevent name collisions.

    FOr instance, if you have a plugin "myplugin" that adds an API controller named "foo", with an action "bar" in it, then the following events are automatically generated: