Skip to main content

API reference

The public surface of

@thunderid/browser, as documented in its reference pages.

functionConfiguration

The `initialize()` method accepts a configuration object that controls how the SDK connects to your ThunderID instance and manages authentication.

Example
import { ThunderIDBrowserClient } from '@thunderid/browser'

const auth = new ThunderIDBrowserClient()

await auth.initialize({
  clientId: '<your-client-id>',
  baseUrl: 'https://localhost:8090',
})
functionEvent Hooks

The Browser SDK provides an event-driven system for reacting to authentication lifecycle events. Register callbacks using the `on()` method to respond to sign-in, sign-out, HTTP request events, and more.

Example
import { Hooks } from '@thunderid/browser'

auth.on(Hooks.SignIn, (user) => {
  console.log('User signed in:', user.displayName)
})

auth.on(Hooks.SignOut, () => {
  console.log('User signed out')
  window.location.href = '/'
})
functionThunderIDBrowserClient

The `ThunderIDBrowserClient` is the core class of the `@thunderid/browser` SDK. It manages the full authentication lifecycle for browser-based applications, including sign-in, sign-out, token management, and authenticated HTTP requests.

Example
import { ThunderIDBrowserClient } from '@thunderid/browser'

const auth = new ThunderIDBrowserClient()

await auth.initialize({
  clientId: '<your-client-id>',
  baseUrl: 'https://localhost:8090',
  afterSignInUrl: window.location.origin,
  afterSignOutUrl: window.location.origin,
})

export default auth
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.