API reference
Full referenceuseThunderID()The
useThunderID composable provides access to the ThunderID authentication context in Nuxt applications. It exposes reactive auth state and SSR-safe methods for signing in, signing out, and signing up. This composable is auto-imported and available in every component, page, and composable without an explicit import.isSignedInComputedRefWhether the user is currently authenticated
isLoadingComputedRefWhether an auth operation is in progress
isInitializedComputedRefWhether the SDK has finished initializing
userComputedRef<User \The authenticated user object, or `null` if not signed in
currentOrganizationUnitComputedRef<CurrentOrganizationUnit | null>The organization unit the session was issued for, read on the server from its `ouId`, `ouHandle`, and `ouName` claims for display only, or `null`
signIn(...args) => PromiseInitiate the sign-in flow
signOut() => PromiseSign out the current user
signUp(...args) => PromiseInitiate the sign-up flow
getAccessToken() => PromiseGet a client-safe access token via `/api/auth/token`
getCurrentOrganizationUnit() => Promise<CurrentOrganizationUnit | null>Resolve with the value of `currentOrganizationUnit`
switchOrganizationUnit(organizationUnitId: string, options?: SwitchOrganizationUnitOptions) => Promise<undefined>Sign in again bounded to another organization unit. Sends the browser to `/api/auth/signin?ouId=<id>`, and the callback replaces the session only when the sign-in succeeds
<script setup lang="ts">const { isSignedIn, user, signIn, signOut } = useThunderID()</script><template><div><p v-if="isSignedIn">Welcome, {{ user?.displayName }}!</p><button v-if="isSignedIn" @click="signOut()">Sign Out</button><button v-else @click="signIn()">Sign In</button></div></template>
Get started
Provider, session, and a protected route, start to finish.
Connect your application
Getting started / Connect your application / Nuxt
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.