Skip to content

Meilisearch JS / index / Config

Type Alias: Config

Config = object

Defined in: src/types/types.ts:47

Main configuration object for the meilisearch client.

Properties

apiKey?

optional apiKey?: string

Defined in: src/types/types.ts:60

API key for interacting with a meilisearch instance.

See

https://www.meilisearch.com/docs/learn/security/basic_security


clientAgents?

optional clientAgents?: string[]

Defined in: src/types/types.ts:65

Custom strings that will be concatted to the "X-Meilisearch-Client" header on each request.


defaultWaitOptions?

optional defaultWaitOptions?: WaitOptions

Defined in: src/types/types.ts:80

Customizable default options for awaiting tasks.


host

host: string

Defined in: src/types/types.ts:54

The base URL for reaching a meilisearch instance.

Remarks

Protocol and trailing slash can be omitted.


httpClient?

optional httpClient?: (...args) => Promise<unknown>

Defined in: src/types/types.ts:76

Custom function that can be provided in place of fetch.

Parameters

args

...Parameters<typeof fetch>

Returns

Promise<unknown>

Remarks

API response errors will have to be handled manually with this as well.

Deprecated

This will be removed in a future version. See issue.


requestInit?

optional requestInit?: BaseRequestInit

Defined in: src/types/types.ts:67

Base request options that may override the default ones.


timeout?

optional timeout?: number

Defined in: src/types/types.ts:78

Timeout in milliseconds for each HTTP request.