Skip to content

ApiClientOptions

type ApiClientOptions: object;

Type declaration

apiPrefix?

optional apiPrefix: string;

The base path for the JSON:API endpoint

authentication?

optional authentication: Authentication;

The authentication configuration to use for authenticated API requests.

cache?

optional cache: Cache;

Default cache implementation Cache

customFetch()?

optional customFetch: (input, init?) => Promise<Response>;

Custom fetch method overrides fetch in the ApiClient

See

https://developer.mozilla.org/en-US/docs/Web/API/fetch

Parameters

input: RequestInfo | URL

input to the customFetch

init?: RequestInit

additional configuration for the request like the method to use, headers, etc.

Returns

Promise<Response>

debug?

optional debug: boolean;

If true, logs debug messages to the console.

defaultLocale?

optional defaultLocale: Locale;

The default locale to use for all API requests.

See

Locale

logger?

optional logger: { [key in LogLevels]?: LogMethod };

Represents a logger object with optional logging methods for various log levels.

serializer?

optional serializer: Serializer;

Custom serializer to use for deserializing api response.

Source

types.ts:13