Guides Prepare for v3

Edit this page

Starting with 2.8.0, we are introducing changes and deprecations to prepare for the upcoming release of InstantSearch.js 3.

Initializing InstantSearch

InstantSearch has always worked with the Algolia search client behind the scenes. This will no longer be the default for InstantSearch.js 3. To prepare this future migration, you can start using the new options now.

Current usage

  1. Import InstantSearch.js
  2. Initialize InstantSearch
const search = instantsearch({
  appId: 'appId',
  apiKey: 'apiKey',
  indexName: 'indexName',
});

search.start();

New usage

  1. Import algoliasearch
  2. Import InstantSearch.js
  3. Initialize InstantSearch with the searchClient option
const search = instantsearch({
  indexName: 'indexName',
  searchClient: algoliasearch('appId', 'apiKey'),
});

search.start();

Deprecations


Can't find what you are looking for? Open an issue, we'll get back to you.