Skip to main content

Class: Client

internal.Client

Properties

axiosClient

Copy to Clipboard axiosClient: Copy to Clipboard

Defined in

medusa-js/src/request.ts:34


config

Copy to Clipboard config: Copy to Clipboard

Defined in

medusa-js/src/request.ts:35

Methods

createClient

createClient(Copy to Clipboard): Copy to Clipboard

Creates the axios client used for requests As part of the creation, we configure the retry conditions and the exponential backoff approach.

Parameters

NameTypeDescription
Copy to ClipboardCopy to Clipboarduser supplied configurations

Returns

Copy to Clipboard

Defined in

medusa-js/src/request.ts:158


normalizeHeader

normalizeHeader(Copy to Clipboard): Copy to Clipboard

Parameters

NameType
Copy to ClipboardCopy to Clipboard

Returns

Copy to Clipboard

Defined in

medusa-js/src/request.ts:88


normalizeHeaders

normalizeHeaders(Copy to Clipboard): Copy to Clipboard<Copy to Clipboard, Copy to Clipboard>

Parameters

NameType
Copy to ClipboardCopy to Clipboard

Returns

Copy to Clipboard<Copy to Clipboard, Copy to Clipboard>

Defined in

medusa-js/src/request.ts:76


request

request(Copy to Clipboard, Copy to Clipboard, Copy to Clipboard, Copy to Clipboard, Copy to Clipboard): Copy to Clipboard<Copy to Clipboard>

Axios request

Parameters

NameTypeDescription
Copy to ClipboardCopy to Clipboardrequest method
Copy to ClipboardCopy to Clipboardrequest path
Copy to ClipboardCopy to Clipboard<Copy to Clipboard, Copy to Clipboard>request payload
Copy to ClipboardCopy to Clipboardaxios configuration
Copy to ClipboardCopy to Clipboard<Copy to Clipboard, Copy to Clipboard>custom request headers

Returns

Copy to Clipboard<Copy to Clipboard>

Defined in

medusa-js/src/request.ts:195


requiresAuthentication

requiresAuthentication(Copy to Clipboard, Copy to Clipboard): Copy to Clipboard

Parameters

NameType
Copy to ClipboardCopy to Clipboard
Copy to ClipboardCopy to Clipboard

Returns

Copy to Clipboard

Defined in

medusa-js/src/request.ts:97


setHeaders

setHeaders(Copy to Clipboard, Copy to Clipboard, Copy to Clipboard, Copy to Clipboard): Copy to Clipboard

Creates all the initial headers. We add the idempotency key, if the request is configured to retry.

Parameters

NameTypeDescription
Copy to ClipboardCopy to Clipboarduser supplied headers
Copy to ClipboardCopy to Clipboardrequest method
Copy to ClipboardCopy to Clipboardrequest path
Copy to ClipboardCopy to Clipboard<Copy to Clipboard, Copy to Clipboard>user supplied headers

Returns

Copy to Clipboard

Defined in

medusa-js/src/request.ts:113


shouldRetryCondition

shouldRetryCondition(Copy to Clipboard, Copy to Clipboard, Copy to Clipboard): Copy to Clipboard

Parameters

NameType
Copy to ClipboardCopy to Clipboard<Copy to Clipboard, Copy to Clipboard>
Copy to ClipboardCopy to Clipboard
Copy to ClipboardCopy to Clipboard

Returns

Copy to Clipboard

Defined in

medusa-js/src/request.ts:45