You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1461: feat: added support for custom request config r=bidoubiwa a=amgadserry
feat: added support for custom http client
# Pull Request
## Related issue
## What does this PR do?
- adds support for usages with preconfigured http clients like axios for using ms through a proxy for example
```
const client: MeiliSearch = new MeiliSearch({
host: 'http://localhost:3000/api/v0/meilisearch/proxy',
httpClient: async (url, opts) => {
const response = await $charles.http!.getClient().request({
url,
data: opts?.body,
headers: opts?.headers
})
return response.data
}
})
```
- adds support for customizing the requests created by `httpRequests`
### BREAKING CHANGES:
- removes `headers` config param and introduces `requestConfig` instead which can be used to customize all fetch config
## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!
Co-authored-by: Amgad Serry <[email protected]>
This package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.
0 commit comments