ZitadelDocs

Nuxt SDK

Nitro middleware and composables for Nuxt applications.

The Nuxt SDK registers server middleware and plugins so Nuxt pages can read Zitadel auth state.

Generated setup

The CLI edits the first matching nuxt.config.{ts,mts,js,mjs} and keeps the backend URL server-side while exposing only the project id publicly.

Install

pnpm add @zitadel/sdk-nuxt

Setup

The CLI adds pages, plugins, module config, environment files, and the SDK package.

pages/login.vue
pages/register.vue
pages/profile.vue
plugins/zitadel-components.client.ts
plugins/auth.server.ts
nuxt.config.ts

Runtime model

Register Nitro middleware for same-origin /__nextgen/* proxying.
Verify the session JWT and attach auth state to the request event.
Use a server plugin to make auth state available to pages.

Verify

  • Start the app with ZITADEL_URL and NUXT_PUBLIC_ZITADEL_PROJECT_ID.
  • Visit /login and register a user.
  • Confirm /profile shows signed-in state.
  • Log out and confirm protected pages redirect to /login.

See also