Skip to content

Type Alias: AuthConfig

@kortexya/reasoninglayer


@kortexya/reasoninglayer / AuthConfig

Type Alias: AuthConfig

AuthConfig = { mode: "bearer"; token: string; } | { mode: "cookie"; }

Defined in: src/config.ts:29

Authentication mode for the SDK.

Two modes are supported:

  • bearer — send Authorization: Bearer <token> on every request. Use this for server-to-server SDK usage where you hold a long-lived API token (e.g. a service-account token issued by the auth gateway).
  • cookie — rely on the browser’s session cookie set by the auth gateway after an interactive login. The SDK will issue requests with credentials: 'include' so the cookie is attached. Use this for in-browser SPAs.

The choice is required and explicit — there is no implicit “no auth” fallback. This prevents silently shipping unauthenticated requests that the gateway will reject at runtime.