Interface SeclaiOptions

Configuration for the Seclai client.

interface SeclaiOptions {
    accessToken?: string | AccessTokenProvider;
    accountId?: string;
    apiKey?: string;
    apiKeyHeader?: string;
    autoRefresh?: boolean;
    baseUrl?: string;
    configDir?: string;
    defaultHeaders?: Record<string, string>;
    fetch?: FetchLike;
    profile?: string;
}

Properties

accessToken?: string | AccessTokenProvider

Static bearer access token or a provider function that returns one. Mutually exclusive with apiKey.

accountId?: string

Target organization account ID. Sent as X-Account-Id header. Overrides the profile's sso_account_id when using SSO auth.

apiKey?: string

API key used for authentication. Defaults to process.env.SECLAI_API_KEY when available.

apiKeyHeader?: string

Header name to use for the API key. Defaults to x-api-key.

autoRefresh?: boolean

Whether to auto-refresh expired SSO tokens. Defaults to true. Set to false in environments that should not write to disk.

baseUrl?: string

API base URL. Defaults to process.env.SECLAI_API_URL when available, else SECLAI_API_URL.

configDir?: string

Override the config directory path (default: SECLAI_CONFIG_DIR env var or ~/.seclai/).

defaultHeaders?: Record<string, string>

Extra headers to include on every request.

fetch?: FetchLike

Optional fetch implementation for environments without a global fetch.

profile?: string

SSO profile name to load from ~/.seclai/config. Defaults to process.env.SECLAI_PROFILE, then "default".