Skip to main content

Interface: ClientConfig

Properties​

alertEndpoint​

• Optional alertEndpoint: string

Desc

An endpoint to hit when a user's session information is updated

Default

undefined

Example

"https://xyz123.abc/random-page"

Defined in​

types.ts:68


alertEndpointOpts​

• Optional alertEndpointOpts: RequestInit

Defined in​

types.ts:69


apiServerOrigin​

• Optional apiServerOrigin: string

Description

Set the API server's origin if different from the current page's origin to prevent CORS errors

Example

"http://localhost:4000"

Default

self.location.origin

Defined in​

types.ts:21


disableSilentLogin​

• Optional disableSilentLogin: boolean

Description

Disables ability for the client to authenticate with Keycloak silently

Default

false

Defined in​

types.ts:36


eagerRefreshTime​

• Optional eagerRefreshTime: number | false

Desc

The amount of time in minutes the client should attempt to refresh the access token in order to keep it from expiring (NOTE: KCC server MUST be configured with a time at or greater). Set false to disable.

Default

2.5 minutes

Defined in​

types.ts:61


fastInitialAuthCheck​

• Optional fastInitialAuthCheck: boolean

Desc

When true, the client will not perform a network request to confirm login status if the user has a valid access token, resulting in an immediate login in some instances.

Default

false

Defined in​

types.ts:53


logger​

• Optional logger: Logger

Pass a logger to the client. This is useful for debugging and logging.

Example

import pino from "pino";
const logger = pino();

const client = new KCClient({logger});

Defined in​

types.ts:46


routePaths​

• Optional routePaths: CustomRouteUrl

Description

Used if the API server uses custom auth route paths

Default

{
* _prefix: "/auth";
* ...
* }

Defined in​

types.ts:30