Skip to main content

Interface: FrappeClientOptions

Defined in: packages/client/src/core/config.ts:15

Properties

apiVersion?

optional apiVersion?: ApiVersion

Defined in: packages/client/src/core/config.ts:19

1 for classic /api/method + /api/resource (v14-safe). 2 for /api/v2 (v15+). Default 2.


auth?

optional auth?: AuthStrategy

Defined in: packages/client/src/core/config.ts:30

Authentication strategy. Default anonymousAuth().


credentials?

optional credentials?: RequestCredentials

Defined in: packages/client/src/core/config.ts:51

RequestInit.credentials for the default transport. Default: 'include' when auth.name === 'cookie' in a browser, otherwise 'same-origin'.


fetch?

optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: packages/client/src/core/config.ts:44

Fetch implementation to use instead of globalThis.fetch. For polyfills, instrumentation, or SSR runtimes without a global fetch. Ignored if transport is set.

Call Signature

(input, init?): Promise<Response>

MDN Reference

Parameters
input

RequestInfo | URL

init?

RequestInit

Returns

Promise<Response>

Call Signature

(input, init?): Promise<Response>

MDN Reference

Parameters
input

string | Request | URL

init?

RequestInit

Returns

Promise<Response>


frappeVersion?

optional frappeVersion?: FrappeVersion

Defined in: packages/client/src/core/config.ts:26

Hint for release-specific behavior (validate_link vs validate_link_and_fetch, whether get_list accepts expand, whether the v2 REST list endpoint honors orFilters/parent). Optional — every behavior this hint gates has a conservative default when omitted. Frappe 16 sites must pass 16 so validateLink does not call the removed validate_link RPC.


headers?

optional headers?: Record<string, string>

Defined in: packages/client/src/core/config.ts:32

Headers merged into every request, lowest precedence (per-request headers win).


logger?

optional logger?: FrappeLogger

Defined in: packages/client/src/core/config.ts:40

Logger that never receives headers, bodies, or query strings. Off by default.


middleware?

optional middleware?: Middleware[]

Defined in: packages/client/src/core/config.ts:42

Middleware applied to every request, in array order (first wraps outermost).


siteName?

optional siteName?: string

Defined in: packages/client/src/core/config.ts:38

Frappe site hostname when the URL host does not match the site (e.g. http://127.0.0.1:8001 with site frappe16.localhost). Sets Host (outside a browser, where Host cannot be set) and X-Frappe-Site-Name.


timeout?

optional timeout?: number

Defined in: packages/client/src/core/config.ts:28

Default 30_000. Overridable per-request via RequestOptions.timeout, applied per attempt.


transport?

optional transport?: Transport

Defined in: packages/client/src/core/config.ts:46

Replaces the default FetchTransport entirely. testing.ts's MemoryTransport is the built-in example.


url

url: string

Defined in: packages/client/src/core/config.ts:17

Base URL of the Frappe site, e.g. https://frappe.example.com.