Skip to main content

`ThunderIDNodeConfig`

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

ThunderIDNodeConfig is the configuration type for the Choreo Identity & Access Management Node.js SDK. The type extends the base Config from @thunderid/javascript and adds a Node.js-specific option for controlling session cookie lifetime.

Usage​

Pass a ThunderIDNodeConfig object to the initialize method of your client:

src/auth.ts
import { ThunderIDNodeConfig } from '@thunderid/node'

const config: ThunderIDNodeConfig = {
clientId: '<your-client-id>',
serverOrigin: 'https://<DATA_PLANE_URL>',
afterSignInUrl: 'http://localhost:3000/callback',
afterSignOutUrl: 'http://localhost:3000',
sessionCookieExpiryTime: 28800, // 8 hours
}

Properties​

Node.js-Specific Properties​

PropertyTypeRequiredDefaultDescription
sessionCookieSessionCookieConfig❌-Session cookie settings (expiry, httpOnly, sameSite, secure).
sessionCookie.expiryTimenumber❌86400 (24 hours)Session cookie lifetime in seconds. Determines how long the session cookie remains valid after sign-in.

Resolution Order for sessionCookie.expiryTime​

The SDK resolves the session cookie expiry time in the following order, using the first defined value:

  1. The sessionCookie.expiryTime property in the configuration object.
  2. The THUNDERID_SESSION_COOKIE_EXPIRY_TIME environment variable.
  3. The built-in default of 86400 seconds (24 hours).

Inherited Base Properties​

ThunderIDNodeConfig inherits all properties from the base Config type in @thunderid/javascript. The following table lists the most commonly used inherited properties:

PropertyTypeRequiredDescription
clientIdstring✅The client ID of your application registered in Choreo Identity & Access Management.
serverOriginstring✅The base URL of the Choreo Identity & Access Management instance (for example, https://<DATA_PLANE_URL>).
afterSignInUrlstring❌The URL to redirect to after a successful sign-in.
afterSignOutUrlstring❌The URL to redirect to after sign-out.
clientSecretstring❌The client secret. Required for confidential clients only.
scopestring[]❌The OAuth 2.0 scopes to request. Defaults to ['openid', 'profile'].

Example​

import { ThunderIDNodeConfig } from '@thunderid/node'

const config: ThunderIDNodeConfig = {
clientId: '<your-client-id>',
serverOrigin: 'https://<DATA_PLANE_URL>',
afterSignInUrl: 'http://localhost:3000/callback',
afterSignOutUrl: 'http://localhost:3000',
scope: ['openid', 'profile'],
sessionCookieExpiryTime: 3600, // 1 hour
}

Was this page helpful?