OptionalautocompletePreact autocomplete main component
Minimal input length to render autocomplete
OptionalautocompleteDefault autocomplete page query parameters. Supplied as an object or a function that returning search query Functional version can be use for building complex autocomplete queries. It's more flexible and provides access to other config parameters.
returns current brand
OptionalcategoryCategory root component
OptionalcategoryCSS selector for category content rendering
OptionalcategoryEnable category fallback when service is unavailable (overwrites global fallback option).
By default it will redirect to original page by disabling new page. If custom function is provided, it will be called with query object.
It's important that this path does not have same path as search page.
returns current category id
returns current category path
Default category page query parameters. Supplied as an object or a function that returning search query Functional version can be use for building complex category queries. It's more flexible and provides access to other config parameters.
Indicates if URL parameters should be compressed. If enabled, default range separator is '~'.
OptionalcontentCSS selector for search page rendering.
Debounce delay for search input
Merchant's default Currency.
OptionaldropdownCSS selector for autocomplete dropdown render. Leave undefined for default use (After input element)
OptionalfallbackEnabled fallback for serp & category pages when service is unavailable By default, it will restore the native content.
If set to 'legacy', it will force a page reload and disable the search for the current session.
CSS selector for form to unbind it.
OptionalformForm unbind delay after how long it should delay, default is unbinding without delay ms
Toggles Google Analytics usage. Defaults to true.
OptionalhistoryHistory component
Indicates if history should be enabled
History size
Hit decorators are used to modify the products hits before they are rendered.
OptionalinputCSS selector for each input element to bind search events like input change and form submit.
Determine if current page is category Example: return location.pathname.includes('category')
Enable in-memory caching for autocomplete results.
If enabled, the autocomplete results will be cached in memory, and the same results will be returned for the same query without making a new request.
Merchant ID.
OptionalonCustom callback invoked before the search query is executed.
To cancel the search action, throw an error in this callback.
The action context containing the store and config.
The search options that would be used for the query.
OptionalonCustom error handler for search errors.
The error object that occurred during the search operation. This can be of any type.
The search query that was being executed when the error occurred.
The search options that were used for the query.
Enable persistent caching for search results.
If enabled, the search results will be restored from cache when returning to the search page, from example, from a product page.
The cache is stored in the browser's session storage.
Preserve page scroll position when navigating back to search page.
If enabled, it's highly recommended to also enabled persistentSearchCache for best user experience.
Custom function, when provided, can be used to modify search query before sending it to the server. A default implementation is provided in the config that returns the query without any modification. Note: The query parameter itself should not be touched, but instead a new object should be returned in case modifications are needed.
SearchQuery
PageType | undefined
Maximum time to wait for the injection targets to be available in the page, in milliseconds
Number of retries for search request. Retries won't be applied for autocomplete requests.
Interval between retries in milliseconds
OptionalsearchConfiguration for the search queries
OptionalserpPreact search page main component.
OptionalserpEnable search fallback when service is unavailable (overwrites global fallback option).
By default it will redirect to original page by disabling new page. If custom function is provided, it will be called with query object.
It's important that this path does not have same path as search page.
OptionalserpSearch page path, renders in any page if not specified
Indicates if search should redirect to search page or just rewrite history
In case a function is provided, it will be called with the query object and autocomplete options.
OptionalserpDefault search page query parameters. Supplied as an object or a function that returning search query Functional version can be use for building complex search queries. It's more flexible and provides access to other config parameters.
OptionalserpDelay serp page rendering given until given async function resolves Default function waitForElement can be imported from "@nosto/preact"
Front end URL both ways mapping, to convert URL param values and keep the request keys { query: 'q' - will map query param to appear as q in URL product.filters: 'ff' - will map to ff.0.field.0: 'brand' and so on.. product.size: 'size' - will map to size: 24 }
OptionalspeechSpeech to text component
Indicates if speech to text should be enabled
return current variation id, can be supplying for supplying multi-currency and B2B variations
Full configuration used internally in the Search application