Skip to content

Interface: ClientConfig

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ClientConfig

Defined in: src/config.ts:58

Configuration for the Reasoning Layer 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 Reasoning Layer API (e.g., "http://localhost:8085").


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

Defined in: src/config.ts:87

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 | Request | URL

RequestInit

Promise<Response>


optional interceptors?: Interceptor[]

Defined in: src/config.ts:81

User-provided interceptors inserted into the request pipeline.


optional maxRetries?: number

Defined in: src/config.ts:77

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:79

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:75

Default request timeout in milliseconds. Overridable per-call via RequestOptions.timeoutMs. Default: 30000.


optional userId?: string

Defined in: src/config.ts:69

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