Nuxt
Server-rendered authentication for Nuxt applications, out of the box.
API reference
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.
See the full API reference for every export, its signature and an example.
Composables
-
useThunderID()(hook): TheuseChoreo Identity & Access Managementcomposable provides access to the Choreo Identity & Access Management authentication context in Nuxt applications. -
useUser()(hook): TheuseUsercomposable returns the currently authenticated user object as a reactive computed ref.
Components
-
<ChangeCredential />(component): TheChangeCredentialcomponent renders a form that lets a signed-in user set a new value for one of their own credentials. -
<Loading />(component): TheLoadingcomponent renders its default slot while the authentication state is being resolved. -
<SignInButton />(component): TheSignInButtoncomponent initiates the sign-in flow when clicked. -
<SignOutButton />(component): TheSignOutButtoncomponent signs out the current user when clicked. -
<SignUpButton />(component): TheSignUpButtoncomponent initiates the sign-up flow when clicked. -
<SignedIn />(component): TheSignedIncomponent renders its default slot only when the user is authenticated. -
<SignedOut />(component): TheSignedOutcomponent renders its default slot only when the user is not authenticated. -
<ThunderIDRoot />(component): TheChoreo Identity & Access ManagementRootcomponent is the root provider for the Choreo Identity & Access Management Nuxt SDK. -
<User />(component): TheUsercomponent provides access to the authenticated user object via a scoped slot. -
<UserDropdown />(component): TheUserDropdowncomponent renders a button showing the user's avatar or name. -
<UserProfile />(component): TheUserProfilecomponent renders a full profile management interface.
Middleware
defineThunderIDMiddleware()(middleware):defineThunderIDMiddlewareis a factory function that returns a Nuxt route middleware.
Utilities
createRouteMatcher()(function):createRouteMatchertakes an array of route patterns and returns a predicate function.
Configuration
Module Configuration(export): The@thunderid/nuxtmodule is configured via thethunderidkey innuxt.config.ts.
Errors
ThunderIDError(export):Choreo Identity & Access ManagementErroris the structured error class thrown by the Choreo Identity & Access Management Nuxt SDK.
Server
-
getThunderIDContext()(export):getChoreo Identity & Access ManagementContextreturns the Choreo Identity & Access Management context object that the SDK's server plugin attaches to each H3 event during SSR. -
getValidAccessToken()(export):getValidAccessTokenreturns a valid access token for the current session. -
requireServerSession()(export):requireServerSessionreads the Choreo Identity & Access Management session from the current H3 event and returns the decodedChoreo Identity & Access ManagementSessionPayload. -
useServerSession()(export):useServerSessionreads the Choreo Identity & Access Management session from the current H3 event and returns the decodedChoreo Identity & Access ManagementSessionPayload, ornullif no valid session exists.
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.
Was this page helpful?