Skip to content

TypeScript API / contentia/json-api / JsonApiHttpTransportConfig

Interface: JsonApiHttpTransportConfig ​

Properties ​

authToken? ​

ts
authToken?: string;

baseUrl ​

ts
baseUrl: string;

httpClient? ​

ts
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
networkError?: (message) => ContentiaError;

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 ​

ContentiaError


tokenPromise? ​

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

Dynamic token provider — called before each request.

Returns ​

Promise<string>