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
alertEndpointOpts
• Optional alertEndpointOpts: RequestInit
Defined in
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
disableSilentLogin
• Optional disableSilentLogin: boolean
Description
Disables ability for the client to authenticate with Keycloak silently
Default
false
Defined in
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
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
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
routePaths
• Optional routePaths: CustomRouteUrl
Description
Used if the API server uses custom auth route paths
Default
{
     *     _prefix: "/auth";
     *     ...
     * }