Skip to main content

Module Configuration

The @thunderid/nuxt module is configured via the thunderid key in nuxt.config.ts. The configuration covers credentials, redirect URLs, session handling, and UI preferences.

Usage

nuxt.config.ts
export default defineNuxtConfig({
modules: ['@thunderid/nuxt'],
thunderid: {
clientId: '<your-client-id>',
clientSecret: '<your-client-secret>',
baseUrl: 'https://localhost:8090',
afterSignInUrl: '/dashboard',
afterSignOutUrl: '/',
scopes: ['openid', 'profile', 'internal_login'],
preferences: {
theme: {
inheritFromBranding: true,
mode: 'system',
},
},
},
})

Environment Variables

Secret values should be provided through environment variables rather than hardcoded in nuxt.config.ts. The module reads the following variables automatically:

VariableMaps to
NUXT_PUBLIC_THUNDERID_BASE_URLbaseUrl
NUXT_PUBLIC_THUNDERID_CLIENT_IDclientId
NUXT_THUNDERID_CLIENT_SECRETclientSecret
NUXT_THUNDERID_SESSION_SECRETsessionSecret
note

clientSecret and sessionSecret are placed in the Nuxt private runtime config and are never exposed to the browser.

Configuration Options

OptionTypeRequiredDescription
baseUrlstringThe base URL of the ThunderID instance (e.g., https://localhost:8090)
clientIdstringClient ID of your application
clientSecretstringClient secret of your application
sessionSecretstringSecret used to sign session cookies. Must be at least 32 characters
afterSignInUrlstringURL to redirect to after a successful sign-in. Defaults to '/'
afterSignOutUrlstringURL to redirect to after sign-out. Defaults to '/'
signInUrlstringCustom sign-in page URL. Defaults to '/api/auth/signin'
signUpUrlstringCustom sign-up page URL. Defaults to '/api/auth/signup'
scopesstring[]OIDC scopes to request. Defaults to ['openid', 'profile']
applicationIdstringApplication ID used for branding and flow configuration
platformstringPlatform identifier for the SDK
tokenRequestobjectToken endpoint request configuration
preferencesobjectUI and behavior preferences

tokenRequest

PropertyTypeDescription
authMethodTokenEndpointAuthMethodToken endpoint authentication method (e.g., 'client_secret_basic', 'client_secret_post')

preferences

The preferences object controls SSR data-fetching behavior and UI customization.

Theme (preferences.theme)

PropertyTypeDefaultDescription
inheritFromBrandingbooleantrueFetch branding from ThunderID and apply it to SDK components. Set to false to skip the branding fetch on each SSR request
mode'light' | 'dark' | 'system' | 'class' | 'branding''system'Theme mode. 'system' follows the user's OS preference; 'branding' uses the fetched branding colors

Internationalization (preferences.i18n)

PropertyTypeDefaultDescription
languagestringBrowser defaultDefault language code for SDK UI components (e.g., 'en-US', 'fr-FR')
fallbackLanguagestring'en-US'Fallback language when a translation is not available
bundlesobject{}Custom translation bundles to override default text

User Data (preferences.user)

Controls which data is fetched server-side during SSR and hydrated into the client.

PropertyTypeDefaultDescription
fetchUserProfilebooleantrueFetch the user's SCIM2 profile on each SSR request and hydrate it into the client

Advanced Configuration

Minimal Configuration (No SSR Data Fetching)

Disable server-side data fetching to reduce SSR latency when you don't need user profile data pre-loaded:

nuxt.config.ts
export default defineNuxtConfig({
modules: ['@thunderid/nuxt'],
thunderid: {
clientId: process.env.NUXT_PUBLIC_THUNDERID_CLIENT_ID!,
clientSecret: process.env.NUXT_THUNDERID_CLIENT_SECRET!,
baseUrl: process.env.NUXT_PUBLIC_THUNDERID_BASE_URL!,
preferences: {
theme: {
inheritFromBranding: false,
},
user: {
fetchUserProfile: false,
},
},
},
})
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.Privacy PolicyCookie Policy