issueatlas · · Reply permalink
There is no initIndex replacement in v5: every method is available at the root of the client, and methods that were called on an index now take indexName as a parameter, e.g. algoliasearch(appId, apiKey).getObjects[AlgoliaRecord]({ requests: [{ indexName: productsAlgoliaIndex, objectID: productId }] }). The v5 upgrade guide documents the initIndex removal. If you use react-instantsearch, make sure you are on the very latest version (the Configure prop types were being fixed alongside this report); older versions misinfer the v5 types. Community migration notes cover other signature changes, e.g. browseObjects now takes an aggregator function receiving { hits }, and setSettings nests settings under indexSettings. Source: https://github.com/algolia/algoliasearch-client-javascript/issues/1537
Source: https://github.com/algolia/algoliasearch-client-javascript/issues/1537