Skip to main content
The widgets for displaying recommendations are part of InstantSearch.js, starting with version 4.69.0. The Algolia JavaScript API client supports the Recommend API starting with version 4.23.2. With this, you can integrate recommendations seamlessly into your InstantSearch app, without having to install additional packages.

Packages

Add the instantsearch.js and algoliasearch packages to your project, and remove the @algolia/recommend and @algolia/recommend-js packages:

Imports

Import the Recommend widgets from InstantSearch.js:
JavaScript

Usage

Add the Recommend widgets to the instantsearch component. Pass the API client and name to the instantsearch widget:
JavaScript

Widgets

Changes for frequentlyBoughtTogether

Move recommendClient and indexName to instantsearch

The frequentlyBoughtTogether widget no longer needs recommendClient and indexName props. Instead, pass a searchClient and the ìndexName to instantsearch.
JavaScript

Replace view with the layout template or the connectFrequentlyBoughtTogether connector

The frequentlyBoughtTogether widget no longer provides a view prop. To fully customize the UI, use either the layout template or the connectFrequentlyBoughtTogether connector instead.
Layout template
JavaScript
Connector
JavaScript

Replace component props with templates

The frequentlyBoughtTogether widget uses templates to customize specific parts of its UI.

Replace translations with templates

The frequentlyBoughtTogether widget uses templates to provide translations to the header.
JavaScript

Replace maxRecommendations with limit

The limit prop replaces the maxRecommendations prop.
JavaScript

Remove environment

The environment prop is no longer needed.
JavaScript

Replace classNames with cssClasses

The cssClasses prop replaces the classNames prop.
JavaScript

Changes for relatedProducts

Move recommendClient and indexName to instantsearch

The relatedProducts widget no longer needs recommendClient and indexName props. Instead, pass a searchChlient and the ìndexName to instantsearch.
JavaScript

Replace view with the layout template or the connectRelatedProducts connector

The relatedProducts widget no longer provides a view prop. To fully customize the UI, use either the layout template or the connectRelatedProducts connector instead.
Layout template
JavaScript
Connector
JavaScript

Replace component props with templates

The relatedProducts widget uses templates to customize specific parts of its UI.

Replace translations with templates

The relatedProducts widget uses templates to provide translations to the header.
JavaScript

Replace maxRecommendations with limit

The limit prop replaces the maxRecommendations prop.
JavaScript

Remove environment

The environment prop is no longer needed.
JavaScript

Replace classNames with cssClasses

The cssClasses prop replaces the classNames prop.
JavaScript

Changes for trendingItems

Move recommendClient and indexName to instantsearch

The trendingItems widget no longer needs recommendClient and indexName props. Instead, pass a searchClient and the ìndexName to instantsearch.
JavaScript

Replace view with the layout template or the connectTrendingItems connector

The trendingItems widget no longer provides a view prop. To fully customize the UI, use either the layout template or the connectTrendingItems connector instead.
Layout template
JavaScript
Connector
JavaScript

Replace component props with templates

The trendingItems widget uses templates to customize specific parts of its UI.

Replace translations with templates

The trendingItems widget uses templates to provide translations to the header.
JavaScript

Replace maxRecommendations with limit

The limit prop replaces the maxRecommendations prop.
JavaScript

Remove environment

The environment prop is no longer needed.
JavaScript

Replace classNames with cssClasses

The cssClasses prop replaces the classNames prop.
JavaScript

Changes for trendingFacets

Move recommendClient and indexName to instantsearch

The trendingFacets widget no longer needs recommendClient and indexName props. Instead, pass a searchClient and the indexName to instantsearch.
JavaScript

Replace view with the connectTrendingFacets connector

The trendingFacets widget no longer provides a view prop. To fully customize the UI, use the connectTrendingFacets connector instead.
JavaScript

Replace component props with templates

The trendingFacets widget uses templates to customize specific parts of its UI.

Replace translations with templates

The trendingFacets widget uses templates to provide translations to the header.
JavaScript

Replace maxRecommendations with limit

The limit prop replaces the maxRecommendations prop.
JavaScript

Remove environment

The environment prop is no longer needed.
JavaScript

Replace classNames with cssClasses

The cssClasses prop replaces the classNames prop.
JavaScript

Changes for lookingSimilar

Move recommendClient and indexName to instantsearch

The lookingSimilar widget no longer needs recommendClient and indexName props. Instead, pass a searchChlient and the ìndexName to instantsearch.
JavaScript

Replace view with the layout template or the connectLookingSimilar connector

The lookingSimilar widget no longer provides a view prop. To fully customize the UI, use either the layout template or the connectLookingSimilar connector instead.
Layout template
JavaScript
Connector
JavaScript

Replace component props with templates

The lookingSimilar widget uses templates to customize specific parts of its UI.

Replace translations with templates

The lookingSimilar widget uses templates to provide translations to the header.
JavaScript

Replace maxRecommendations with limit

The limit prop replaces the maxRecommendations prop.
JavaScript

Remove environment

The environment prop is no longer needed.
JavaScript
Replace classNames with cssClasses
The classNames keys have changed and are defined through the cssClasses prop.
JavaScript

horizontalSlider

The horizontalSlider view is now available in InstantSearch.js as a carousel template. For carousel options, check the API reference:
JavaScript
Last modified on July 9, 2026