Skip to main content

Branding

The branding functions fetch the visual configuration (colors, logos, typography) defined in the ThunderID Console and apply it to your UI.

getBrandingPreference(config)

Retrieve the branding preference configuration for an organization or application.

import { getBrandingPreference } from '@thunderid/javascript'

const branding = await getBrandingPreference({
baseUrl: 'https://localhost:8090',
locale: 'en-US',
})

console.log(branding.preference?.theme?.LIGHT?.colors?.primary?.main)

Parameters

ParameterTypeRequiredDescription
config.baseUrlstringThunderID base URL
config.localestringBCP 47 locale for localized branding (e.g., 'en-US')
config.namestringOrganization or application name to scope the request
config.typestringBranding type (e.g., 'ORG', 'APP')
config.fetcherfunctionCustom fetch function override
config.headersRecord<string, string>Additional request headers

Response: BrandingPreference

PropertyTypeDescription
localestringLocale for this branding configuration
namestringOrganization or application name
typestringBranding scope type
preferenceBrandingPreferenceConfigThe branding configuration

BrandingPreferenceConfig

PropertyTypeDescription
themeBrandingThemeLight and dark theme variants
configsobjectGeneral configuration (e.g., isSelfSignUpEnabled)
layoutBrandingLayoutPage layout settings
organizationDetailsBrandingOrganizationDetailsDisplay name, support email, and site URL
urlsUrlsConfigLinks for cookie policy, privacy policy, terms of service

BrandingTheme

PropertyTypeDescription
LIGHTThemeVariantLight mode theme
DARKThemeVariantDark mode theme
activeThemestringWhich theme variant is active ('LIGHT' or 'DARK')

ThemeVariant

PropertyTypeDescription
colorsColorsConfigColor palette
buttonsButtonsConfigButton styles
inputsobjectForm input styles
loginBoxobjectLogin box dimensions and styling
loginPageobjectFull page background and font settings
footerobjectFooter configuration
imagesobjectLogo, favicon, and background image URLs
typographyobjectFont families and sizes

ColorsConfig

PropertyTypeDescription
primaryColorVariantsPrimary brand color (main, light, dark, contrastText)
secondaryColorVariantsSecondary brand color
backgroundobjectPage and surface background colors
textobjectForeground text colors
alertsobjectAlert/notification colors (info, success, warning, error)
outlinedobjectOutlined component colors
illustrationsobjectIllustration accent colors

transformBrandingPreferenceToTheme(branding)

Convert a BrandingPreference response into a Theme object compatible with createTheme(). Used internally by the React and Browser SDKs when preferences.theme.inheritFromBranding is true.

import { getBrandingPreference, transformBrandingPreferenceToTheme } from '@thunderid/javascript'

const branding = await getBrandingPreference({ baseUrl: 'https://localhost:8090' })
const theme = transformBrandingPreferenceToTheme(branding)

Returns: Theme — see Theme for the shape.

ThunderID LogoThunderID Logo

Product

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