Skip to content

TypeScript API / laikacms/json-api / JsonApiHttpTransportConfig

Interface: JsonApiHttpTransportConfig ​

Properties ​

authToken? ​

ts
optional authToken?: string;

baseUrl ​

ts
baseUrl: string;

httpClient? ​

ts
optional httpClient?: HttpClient;

Effect HttpClient used for every request. Provide one client per process (built via httpClientFromFetch or an @effect/platform-node layer) so all repositories share a single connection pool. Defaults to defaultHttpClient.


networkError? ​

ts
optional networkError?: (message) => LaikaError;

Maps transport-level failures (DNS, refused/reset connections) to the repository's fatal error type. Defaults to new InvalidData('Network error: …').

Parameters ​

ParameterType
messagestring

Returns ​

LaikaError


tokenPromise? ​

ts
optional tokenPromise?: () => Promise<string>;

Dynamic token provider — called before each request.

Returns ​

Promise<string>

Released under the MIT License.