API reference
Composables
Components
Middleware
Utilities
Configuration
Errors
Server
hook
useThunderID()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.Returns
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
organizationComputedRef<Organization \The current organization context, 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`
Example
<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.