import type { PlainSearchParameters, RecommendParameters } from 'algoliasearch-helper'; /** * Forwards the insights-related search parameters to every Recommend query. * * The insights middleware writes `userToken` and `clickAnalytics` on the main * helper's search state, which only feeds search queries: Recommend queries are * built from their own parameters and never read the search state. Without this, * recommendations can't be personalized, and their responses carry no `queryID` * for the connectors to attribute click and conversion events with. * * Parameters set on a widget win, so an explicit `queryParameters.userToken` * keeps overriding the middleware. * * The fallback query is a regular search, so it gets the same treatment — but * only merged into a `fallbackParameters` the widget already set. See below. */ export declare function addInsightsToRecommendParameters(recommendParameters: RecommendParameters, { userToken, clickAnalytics }: PlainSearchParameters): RecommendParameters;