Skip to content

Interface: ClientConfig

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ClientConfig

Defined in: src/config.ts:58

Configuration for the ReasoningLayer client.

Required fields: baseUrl, tenantId, and auth. All other fields have sensible defaults. No environment variable auto-detection — configuration is always explicit.

Bearer token (server-side)

const config: ClientConfig = {
baseUrl: 'http://localhost:8085',
tenantId: '550e8400-e29b-41d4-a716-446655440000',
auth: { mode: 'bearer', token: process.env.RL_API_TOKEN! },
};

Session cookie (browser)

const config: ClientConfig = {
baseUrl: 'https://platform.ovh.reasoninglayer.ai',
tenantId: '550e8400-e29b-41d4-a716-446655440000',
auth: { mode: 'cookie' },
};

auth: AuthConfig

Defined in: src/config.ts:67

Authentication mode. Required — pick one of AuthConfig. There is no unauthenticated mode.


optional authenticatedUser?: string

Defined in: src/config.ts:73

Authenticated user identifier for X-Authenticated-User header.


baseUrl: string

Defined in: src/config.ts:60

Base URL of the ReasoningLayer API (e.g., "http://localhost:8085").


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

Defined in: src/config.ts:90

Custom fetch implementation for dependency injection. Useful for testing (inject a mock) or custom environments. Default: globalThis.fetch.

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>


optional interceptors?: Interceptor[]

Defined in: src/config.ts:84

User-provided interceptors inserted into the request pipeline.


optional maxRetries?: number

Defined in: src/config.ts:80

Maximum number of retry attempts. Overridable per-call via RequestOptions.retries. Default: 3.


optional namespaceId?: string

Defined in: src/config.ts:71

Default namespace UUID for X-Namespace-Id header. Overridable per-call via RequestOptions.


optional retryOn503?: boolean

Defined in: src/config.ts:82

Whether to retry on 503 (Service Unavailable). Default: false.


tenantId: string

Defined in: src/config.ts:62

Tenant UUID. Set once, NOT overridable per-call.


optional timeoutMs?: number

Defined in: src/config.ts:78

Default request timeout in milliseconds. Overridable per-call via RequestOptions.timeoutMs. Default: 30000. 0 disables the client deadline; a negative or non-finite value is refused.


optional userId?: string

Defined in: src/config.ts:69

Default user UUID for X-User-Id header. Overridable per-call via RequestOptions.


optional webSocketRenewal?: boolean

Defined in: src/config.ts:106

Keep a live speech WebSocket authorized past the expiry of the token it was opened with: before the gateway would close it, refresh the session (GET /auth/refresh) and renew the socket in place (POST /auth/ws-renew). A gateway without renewal is detected on the first attempt and the socket then closes at its deadline as before. Default: true.


optional webSocketTickets?: boolean

Defined in: src/config.ts:98

Authenticate speech WebSockets with a single-use ticket from the gateway (POST /auth/ws-ticket) instead of the cookie or a ?token= in the socket URL. Needed where the handshake cannot carry the credential, e.g. a browser extension whose session cookie is SameSite=Lax. Requires a gateway that serves /auth/ws-ticket. Default: false.