Defjs
Core

ClientOptions

Input-shaped client options, including SSE and WebSocket, that mirror what the option helpers configure.

@defjs/core · Type

Signature

interface ClientOptions extends HttpClientOptions {
  sse?: ClientSSEOptions;
  webSocket?: ClientWebSocketOptions;
}

The user-facing shape of the settings before defaults are applied. createClient does not accept this object; configure a client with option helpers such as withEndpoint. ClientConfig is the resolved counterpart. The HTTP members come from the non-exported HttpClientOptions base and are shown inline.

Members

Prop

Type

sse? ClientSSEOptions | undefined

SSE transport and reconnect options.

webSocket? ClientWebSocketOptions | undefined

WebSocket transport, heartbeat, and reconnect options.

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; } | undefined

HTTP transport overrides; the default resolves global fetch on each call.

interceptors? Interceptor[] | undefined

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

XSRF cookie/header mapping and optional token provider.

withCredentials? boolean | undefined

When true, credentials are included with requests.

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