BrowseClient#searchProducts(searchParams, options);
Searching for products is a common requriement for an eCommerce site. This portion of the SDK handling advanced searching as well as type-ahead suggestions.
Parameter | Type | Required? | Description |
---|---|---|---|
|
✅ |
Provide filters, queries, and sorting |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a SearchResponse<Product> or SearchRedirectResponse.
const response = await browseClient.searchProducts({
query: 'green'
});
console.log(response);
const response = await browseClient.searchProducts({
query: 'green',
filters: [
{
name: 'price',
ranges: [
{ minValue: '0', maxValue: '100' }
]
}
]
});
console.log(response.content);
Parameter | Type | Required? | Description |
---|---|---|---|
|
✅ |
The criteria for the TypeAhead suggestions |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a SearchSuggestionsResponse