Skip to main content
Build filters using the type-safe filter DSL:

Filter operators

Filter types

The DSL produces FilterGroup and FilterExpression objects. You typically do not construct these manually, but the types are exported if you need to build filters programmatically:
The filter() function wraps a single expression in a FilterGroup automatically, so you can pass either an expression or a group:

Runtime facet discovery

In v3, available facets and their counts are fetched at runtime using sdk.facets(). This replaces the facets array that was passed to createClient() in v2.
You can also request filtered facet counts by passing the same filterGroup the shopper has selected:

Filter shorthand

If a single expression is all you need, pass it directly to filter(). It is equivalent to and(...) for one expression.

Next steps