Defjs
Core

ClientConfig

Resolved client configuration after option helpers have been applied.

@defjs/core · Type

Signature

interface ClientConfig extends HttpClientConfig {
  sse: ClientSSEConfig;
  webSocket: ClientWebSocketOptions;
}

The snapshot that createClient builds, that every option helper mutates, and that instances from createClient hold. The HTTP members come from a non-exported HttpClientConfig base and are shown inline.

Before any option applies, endpoint is '', interceptors is empty, and http.handle and sse.handle share a default wrapper that resolves globalThis.fetch on each call. Replacing Fetch after import affects both defaults. Core can be imported without Fetch; a default HTTP/SSE execution fails with ENV_UNSUPPORTED if it is still missing. Custom handles do not require a global Fetch. webSocket.handle is globalThis.WebSocket, and the other webSocket settings are unset. withXSRF fills xsrf.cookieName with XSRF-TOKEN and xsrf.headerName with X-XSRF-TOKEN when they are omitted.

Members

Prop

Type

sse ClientSSEConfig

Resolved SSE configuration.

webSocket ClientWebSocketOptions

Resolved WebSocket configuration.

endpoint string

Base URL prepended to relative request paths.

headers? Headers | undefined

Static default headers merged under headers returned by the builder for HTTP/SSE.

http { handle: FetchHandle; }

HTTP transport with a required fetch handle.

interceptors Interceptor[]

Interceptors applied in registration order.

querySerializer? QuerySerializer | undefined

Serializes encoded query objects. Omit to use URLSearchParams.

xsrf? { cookieName: string; headerName: string; tokenProvider?: (context: { request: HttpRequest; }) => string | null | undefined; } | undefined

Resolved XSRF settings when enabled.

withCredentials? boolean | undefined

When true, credentials are included with requests.

Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao