This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk / ResponseHookContext

ResponseHookContext ​

Context of a received response, for EnginexClientHooks.onResponse.

Extends ​

Properties ​

attempt ​

attempt: number

Attempt number: 1 on the first call, 2 on the retry after a renewed 401. In onError, it may be 0 when the call failed before any network attempt (e.g. CONFIGURATION_ERROR while resolving baseUrl/tenantHost/fetch).

Inherited from ​

RequestHookContext.attempt


body? ​

optional body?: RequestBodySummary

Body summary, only on multipart requests (e.g. kyc.uploadDocument): the name of each field and, for files, type and size — never the original name or the content of the file, nor the value of text fields. Absent on the other requests (JSON body or no body), whose body never reaches the hooks.

Inherited from ​

RequestHookContext.body


durationMs ​

durationMs: number

Duration of the attempt, in milliseconds.


method ​

method: HttpMethod

HTTP method.

Inherited from ​

RequestHookContext.method


path ​

path: string

Path after /api/v1, without a query string, e.g. /auth/login.

Inherited from ​

RequestHookContext.path


requestId? ​

optional requestId?: string

The response's X-Request-ID, when there is one.


status ​

status: number

HTTP status of the response.


url ​

url: string

Request URL without the query string: baseUrl + /api/v1 + path, e.g. https://gateway.operator.com/api/v1/auth/login. With baseUrl: '' (same-origin, the default) it is relative, e.g. /api/v1/auth/login.

Inherited from ​

RequestHookContext.url