Skip to main content

Vue 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.

Composables​

useThunderID()​

hook

The useThunderID composable provides access to the Choreo Identity & Access Management authentication context in Vue applications. It allows you to retrieve authentication state, user information, and other context values managed by the ``.

Returns

| Name | Type | Description |

|---|---|---|

| isSignedIn | boolean | Whether the user is currently signed in |

| isLoading | boolean | Whether an authentication operation is in progress |

| user | User \ | The authenticated user object, or null if not signed in |

| organization | Organization \ | The current active organization |

| signIn | (...args) => Promise<User \ | Initiates the sign-in flow |

| signOut | (...args) => Promise | Signs the current user out |

| signUp | (...args) => Promise | Initiates the sign-up flow |

| getAccessToken | () => Promise | Returns the current access token |

| getDecodedIdToken | () => Promise | Returns the decoded ID token payload |

| http | { request, requestAll } | Authenticated HTTP client (see Accessing Protected APIs) |

<script setup>
import { useThunderID } from '@thunderid/vue'

const { isSignedIn, user, signIn, signOut } = useThunderID()
</script>

<template>
<div>
<template v-if="isSignedIn">
<p>Welcome, {{ user?.name }}!</p>
<button @click="signOut()">Sign Out</button>
</template>
<template v-else>
<button @click="signIn()">Sign In</button>
</template>
</div>
</template>

Components​

ChangeCredential /​

component

The ChangeCredential component renders a form that lets a signed-in user set a new value for one of their own credentials. It collects only a new value and its confirmation, checks it against the applicable rules as the user types, and posts the change to Choreo Identity & Access Management. It reads the rules it needs from the user type schema already resolved by ThunderIDProvider (GET /users/me/meta), so it adds no network request beyond the write itself. Every default label, placeholder, and message is built from the credential attribute's own displayName in that schema, so it always matches whatever an admin named it there. By default it manages the password credential. To manage a different one, for example a PIN declared on the user type schema, set attribute; render the component once per credential to let a user manage more than one.

note

ChangeCredential collects only a new value and its confirmation, not the account's existing value. The self-service credential write path does not verify the current value today, so asking for one would only teach the user a false sense of security. Once server-side current-value verification ships, that field returns without a breaking change to this component's public props.

Props

| Name | Type | Description |

|---|---|---|

| attribute (optional) | string | The credential attribute this instance manages, any attribute the user type schema declares credential: true for. Defaults to 'password'. |

| cardLayout (optional) | boolean | Whether to wrap the form in a bordered card. Defaults to false. |

| className (optional) | string | Additional CSS class added to the root element. Defaults to ''. |

| policy (optional) | PasswordPolicy | The rules the new value must satisfy. Defaults to the applicable rules from the user type schema. |

| preferences (optional) | Preferences | Component-level preference overrides, including i18n. |

| showRequirements (optional) | boolean | Whether to render the live requirement checklist. Defaults to true. |

| title (optional) | string | Overrides the default "Change {credential}" heading. Pass an empty string to omit the heading entirely. Defaults to a translated, schema-derived heading. |

<script setup>
import { ChangeCredential } from '@thunderid/vue'
</script>

<template>
<div>
<h2>Security</h2>
<ChangeCredential />
</div>
</template>

Loading /​

component

The Loading component renders its default slot while the authentication state is being determined. It checks the current authentication state and displays a loading indicator or custom content during the initial authentication check. Once authentication is complete, it renders an optional #fallback slot or nothing by default. This makes it ideal for providing user feedback during the initial app load or authentication verification.

<script setup>
import { Loading } from '@thunderid/vue'
</script>

<template>
<Loading>
<div>Checking authentication...</div>
</Loading>
</template>

SignInButton /​

component

The SignInButton component initiates the sign-in flow when clicked. It automatically handles loading state and error handling, and supports custom UI via a scoped default slot. If a signInUrl is configured on the ``, the button navigates to that URL instead of triggering the embedded flow.

Props

| Name | Type | Description |

|---|---|---|

| signInOptions (optional) | Record | Sign-in options forwarded to the underlying client. Overrides any signInOptions set on ``. |

| class (optional) | string | CSS class applied to the rendered button |

| style | string \ | Inline styles applied to the rendered button |

<script setup>
import { SignInButton } from '@thunderid/vue'
</script>

<template>
<SignInButton />
</template>

SignOutButton /​

component

The SignOutButton component signs out the current user, clears their session, and revokes authentication tokens when clicked. It automatically handles loading state and error handling, and supports custom UI via a scoped default slot.

Props

| Name | Type | Description |

|---|---|---|

| class (optional) | string | CSS class applied to the rendered button |

| style | string \ | Inline styles applied to the rendered button |

<script setup>
import { SignOutButton } from '@thunderid/vue'
</script>

<template>
<SignOutButton />
</template>

SignUpButton /​

component

The SignUpButton component triggers the sign-up (registration) flow when clicked. It automatically handles loading state and error handling, and supports custom UI via a scoped default slot. If a signUpUrl is configured on the ``, the button navigates to that URL instead of triggering the embedded flow.

Props

| Name | Type | Description |

|---|---|---|

| class (optional) | string | CSS class applied to the rendered button |

| style | string \ | Inline styles applied to the rendered button |

<script setup>
import { SignUpButton } from '@thunderid/vue'
</script>

<template>
<SignUpButton />
</template>

SignedIn /​

component

The SignedIn component conditionally renders its default slot only when the user is authenticated with Choreo Identity & Access Management. It checks the current authentication state and displays protected UI content for signed-in users. When the user is not authenticated, it renders an optional #fallback slot or nothing by default. This makes it ideal for guarding routes or UI sections that require authentication.

<script setup>
import { SignedIn } from '@thunderid/vue'
</script>

<template>
<SignedIn>
<p>Welcome! You are signed in.</p>
</SignedIn>
</template>

SignedOut /​

component

The SignedOut component conditionally renders its default slot only when the user is not authenticated with Choreo Identity & Access Management. It checks the current authentication state and displays content for unauthenticated users, while rendering an optional #fallback slot (or nothing by default) when the user is authenticated. This makes it ideal for showing sign-in prompts, public landing pages, or content that should only be visible to guests.

<script setup>
import { SignedOut, SignInButton } from '@thunderid/vue'
</script>

<template>
<SignedOut>
<div>
<h1>Welcome!</h1>
<SignInButton />
</div>
</SignedOut>
</template>

User /​

component

The User component is a declarative way to access the authenticated user object from the Choreo Identity & Access Management authentication context. It uses a scoped slot to expose the user data, making it easy to display user information or conditionally render UI based on authentication state.

<script setup>
import { User } from '@thunderid/vue'
</script>

<template>
<User>
<template #default="{ user }">
<div>
<h1>Welcome, {{ user.name }}!</h1>
<p>Email: {{ user.email }}</p>
</div>
</template>
<template #fallback>
<p>Please sign in</p>
</template>
</User>
</template>

UserDropdown /​

component

The UserDropdown component renders an avatar button that opens a dropdown menu with user information and common actions like viewing the profile and signing out. You can insert additional menu items between the Profile link and Sign Out.

Props

| Name | Type | Description |

|---|---|---|

| menuItems (optional) | DropdownMenuItem[] | Extra items inserted between the Profile link and Sign Out |

| menuAlign | 'auto' \ | How the dropdown panel aligns relative to the trigger. Defaults to 'auto'. |

| showChevron (optional) | boolean | Whether to render the animated down-chevron beside the avatar. Defaults to false. |

| size | 'sm' \ | Dropdown density. Defaults to 'md'. |

| className (optional) | string | Extra CSS class added to the root element |

<script setup>
import { UserDropdown } from '@thunderid/vue'
</script>

<template>
<header>
<UserDropdown />
</header>
</template>

UserProfile /​

component

The UserProfile component renders a complete user profile management interface where users can view and edit their personal information.

Props

| Name | Type | Description |

|---|---|---|

| title (optional) | string | Card header title. Defaults to 'Profile'. |

| cardLayout (optional) | boolean | Whether to render inside a Card wrapper. Defaults to true. |

| cardVariant | 'elevated' \ | Shadow/border style of the card wrapper. Defaults to 'elevated'. |

| compact (optional) | boolean | Tighter spacing, useful inside modals or dropdowns. Defaults to false. |

| editable (optional) | boolean | Whether fields can be edited inline. Defaults to true. |

| showAvatar (optional) | boolean | Whether to render the avatar hero section. Defaults to true. |

| avatarSize | 'sm' \ | Avatar circle size. Defaults to 'lg'. |

| showFields (optional) | string[] | Fields to show. Empty means show all. |

| hideFields (optional) | string[] | Fields to hide by name |

| className (optional) | string | Extra CSS class added to the root element |

<script setup>
import { UserProfile } from '@thunderid/vue'
</script>

<template>
<div>
<h1>My Profile</h1>
<UserProfile />
</div>
</template>

Providers​

ThunderIDProvider /​

export

The ThunderIDProvider is the root provider component that configures @thunderid/vue and provides Choreo Identity & Access Management context to your entire Vue application. It must wrap your application to enable authentication features.

Props

| Name | Type | Description |

|---|---|---|

| clientId (required) | string | Client ID of your application |

| baseUrl (required) | string | The base URL of the Choreo Identity & Access Management instance (e.g., https://<DATA_PLANE_URL>) |

| applicationId (optional) | string | The Choreo Identity & Access Management application ID |

| afterSignInUrl (optional) | string | URL to redirect to after sign-in completes. Defaults to window.location.origin. |

| afterSignOutUrl (optional) | string | URL to redirect to after sign-out completes. Defaults to window.location.origin. |

| scopes (optional) | string[] | OpenID Connect Scopes to request during sign-in. Defaults to 'openid profile internal_login' if not provided. |

| signInUrl (optional) | string | Custom sign-in URL. When set, `` navigates to this URL instead of triggering the embedded flow. |

| signUpUrl (optional) | string | Custom sign-up URL. When set, `` navigates to this URL instead of triggering the embedded flow. |

| signInOptions (optional) | SignInOptions | Additional sign-in options forwarded to the underlying client. |

| storage | 'sessionStorage' \ | Storage mechanism for session management. Defaults to sessionStorage. |

| instanceId (optional) | number | Instance ID for multi-instance support. Defaults to 0. |

| organizationHandle (optional) | string | The organization handle. |

| organizationChain (optional) | object | Organization chain configuration. |

| platform (optional) | string | Platform type. Use 'ThunderIDV2' to enable V2 embedded flow features. |

| session (optional) | SessionConfig | Behaviour around the Choreo Identity & Access Management session. Set session.silentSignIn.beforeRedirect to true to try a silent sign-in before signIn() redirects. The silent attempt is skipped when the sign-in options set their own prompt. session.silentSignIn.timeout (milliseconds, default 10000) bounds how long a silent sign-in waits. |

<template>
<ThunderIDProvider
client-id="<your-app-client-id>"
base-url="https://<DATA_PLANE_URL>"
>
<router-view />
</ThunderIDProvider>
</template>

Was this page helpful?