Filters are an essential part of the plugin development process. They allow you to modify and manipulate data before it is sent to the client or after it is received from the client. This document provides an overview of the filters available in the community/plugin_dev/docs/en/ area.
Available Filters
Here is a list of some of the commonly used filters:
before_send
: This filter is executed before the response is sent to the client.after Receive
: This filter is executed after the request is received from the client.on_error
: This filter is executed when an error occurs during the request or response process.
Usage Example
Suppose you want to modify the response data before it is sent to the client. You can use the before_send
filter as follows:
filter.before_send = (request, response) => {
// Modify the response data here
response.data = { ...response.data, modified: true };
};
Further Reading
For more information on filters, please refer to the Plugin Development Documentation.
Filter Icon