Skip to main content

Nuxt

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

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): The useChoreo Identity & Access Management composable provides access to the Choreo Identity & Access Management authentication context in Nuxt applications.

  • useUser() (hook): The useUser composable returns the currently authenticated user object as a reactive computed ref.

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.

  • <Loading /> (component): The Loading component renders its default slot while the authentication state is being resolved.

  • <SignInButton /> (component): The SignInButton component initiates the sign-in flow when clicked.

  • <SignOutButton /> (component): The SignOutButton component signs out the current user when clicked.

  • <SignUpButton /> (component): The SignUpButton component initiates the sign-up flow when clicked.

  • <SignedIn /> (component): The SignedIn component renders its default slot only when the user is authenticated.

  • <SignedOut /> (component): The SignedOut component renders its default slot only when the user is not authenticated.

  • <ThunderIDRoot /> (component): The Choreo Identity & Access ManagementRoot component is the root provider for the Choreo Identity & Access Management Nuxt SDK.

  • <User /> (component): The User component provides access to the authenticated user object via a scoped slot.

  • <UserDropdown /> (component): The UserDropdown component renders a button showing the user's avatar or name.

  • <UserProfile /> (component): The UserProfile component renders a full profile management interface.

Middleware​

  • defineThunderIDMiddleware() (middleware): defineThunderIDMiddleware is a factory function that returns a Nuxt route middleware.

Utilities​

  • createRouteMatcher() (function): createRouteMatcher takes an array of route patterns and returns a predicate function.

Configuration​

  • Module Configuration (export): The @thunderid/nuxt module is configured via the thunderid key in nuxt.config.ts.

Errors​

  • ThunderIDError (export): Choreo Identity & Access ManagementError is the structured error class thrown by the Choreo Identity & Access Management Nuxt SDK.

Server​

  • getThunderIDContext() (export): getChoreo Identity & Access ManagementContext returns the Choreo Identity & Access Management context object that the SDK's server plugin attaches to each H3 event during SSR.

  • getValidAccessToken() (export): getValidAccessToken returns a valid access token for the current session.

  • requireServerSession() (export): requireServerSession reads the Choreo Identity & Access Management session from the current H3 event and returns the decoded Choreo Identity & Access ManagementSessionPayload.

  • useServerSession() (export): useServerSession reads the Choreo Identity & Access Management session from the current H3 event and returns the decoded Choreo Identity & Access ManagementSessionPayload, or null if 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?