API reference
Full referenceuseThunderID()The
useThunderID composable provides access to the ThunderID authentication context in Vue applications. It allows you to retrieve authentication state, user information, and other context values managed by the .isSignedInbooleanWhether the user is currently signed in
isLoadingbooleanWhether an authentication operation is in progress
userUser \The authenticated user object, or `null` if not signed in
currentOrganizationUnitCurrentOrganizationUnit | nullThe organization unit the session was issued for, read from its `ouId`, `ouHandle`, and `ouName` claims for display only, or `null`
signIn(...args) => Promise<User \Initiates the sign-in flow
signOut(...args) => PromiseSigns the current user out
signUp(...args) => PromiseInitiates the sign-up flow
getAccessToken() => PromiseReturns the current access token
getDecodedIdToken() => PromiseReturns the decoded ID token payload
http{ request, requestAll }Authenticated HTTP client (see Accessing Protected APIs)
getCurrentOrganizationUnit() => Promise<CurrentOrganizationUnit | null>Reads the current organization unit from the session's claims
switchOrganizationUnit(organizationUnitId: string, options?: SwitchOrganizationUnitOptions) => Promise<User | undefined>Signs in again bounded to another organization unit. A failed switch keeps the previous session, unless a backend reports that its session has ended, and rejects with a code from `OrganizationUnitSwitchErrorCodes`
<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>
Get started
Provider, session, and a protected route, start to finish.
Connect your application
Getting started / Connect your application / Vue
The quickstart is maintained alongside the rest of the getting-started guides so it stays in step with the platform. This page covers the package itself.
Guides
Task-focused walkthroughs maintained alongside the SDK.