Filters enable you to customize and filter your streams payload using JavaScript (ECMAScript) code. With the help of filters, you can match specific patterns and rules against the data from your stream, and personalize the data sent to your destination. This feature is in beta and can be configured within the QuickNode developer portal, and through the Streams REST API.
Understanding Filters
In Streams, a filter_function
is an optional configuration option for your stream. This function must be named main
and it modifies the data out of the stream before it's sent to its destination. Using filters, you can precisely control the data you receive, ensuring you only pay for and process the data you need.
Benefits of Filters
- Cost Efficiency: Reduce your data and costs significantly down to a minimum of 2.5KB per block.
- Customizability: Implement custom filter functions to match specific patterns or criteria, offering great flexibility in data handling.
- Enhanced Data Relevance: Filters ensure that you receive data that is directly relevant to your needs, increasing the overall usefulness of the data.
- Modify the Payload Before Streaming: Customize the payload from your stream before it is sent to your Streams destination.