Skip to main content

Browser API reference

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

Every export is fully typed. The signatures and props below come from the package's own reference documentation, so what is listed here is what the installed version ships.

Functions​

Configuration​

function

The initialize() method accepts a configuration object that controls how the SDK connects to your Choreo Identity & Access Management instance and manages authentication.

import { ThunderIDBrowserClient } from '@thunderid/browser'

const auth = new ThunderIDBrowserClient()

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

Event Hooks​

function

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.

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 = '/'
})

ThunderIDBrowserClient​

function

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.

import { ThunderIDBrowserClient } from '@thunderid/browser'

const auth = new ThunderIDBrowserClient()

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

export default auth

Was this page helpful?