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
baseUrlstring✅The base URL of the ThunderID instance (e.g., https://localhost:8090)
clientIdstring✅Client ID of your application
clientSecretstring✅Client secret of your application
sessionSecretstring✅Secret used to sign session cookies. Must be at least 32 characters
afterSignInUrlstring❌URL to redirect to after a successful sign-in. Defaults to '/'
afterSignOutUrlstring❌URL to redirect to after sign-out. Defaults to '/'
signInUrlstring❌Custom sign-in page URL. Defaults to '/api/auth/signin'
signUpUrlstring❌Custom sign-up page URL. Defaults to '/api/auth/signup'
scopesstring[]❌OIDC scopes to request. Defaults to ['openid', 'profile']
applicationIdstring❌Application ID used for branding and flow configuration
platformstring❌Platform identifier for the SDK
tokenRequestobject❌Token endpoint request configuration
preferencesobject❌UI 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 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,
},
},
},
})

Explore with AI

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.