meilisearch / meilisearch-js-plugins

The search client to use Meilisearch with InstantSearch.

Home Page:https://www.meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add the possibility to provide a custom HTTP client and custom RequestOptions

bidoubiwa opened this issue · comments

Description
As per the in meilisearch-js of this PR meilisearch/meilisearch-js#1461, it is now possible to provide a custom HTTP client and custom Request options.

The possibility of providing these two options should definitely be added in instant-meilisearch.

For example like this:

const searchClient = instantMeiliSearch('http://localhost:7700', 'x', {
  keepZeroFacets: true,
  httpClient: async (url, init) => {
    const result = await fetch(url, init)
    return result.json()
  },
  requestOptions: {
    keepalive: true
  }

})

Fixes: #928