
nuxt-users
Configure and use the nuxt-users module for Nuxt. Use when adding authentication, user management, roles, password reset, database setup (SQLite/MySQL/PostgreSQL), or CLI commands (migrate, create-user). Covers nuxt.config (nuxtUsers), composables (useAuthentication, useUsers, usePublicPaths, usePasswordValidation, useNuxtUsersLocale), components (NUsersLoginForm, NUsersLogoutLink, etc.), and authorization (whitelist, permissions).
- Installs
- 194
- Last 24h
- +9
- Trending rank
- #9079
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/onmax/nuxt-skills --skill nuxt-users- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads nuxt-users automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Nuxt Users skill
Initial setup
-
Install the module and peer dependencies
npm install nuxt-users npm install db0 better-sqlite3 bcrypt nodemailerFor MySQL or PostgreSQL, install the corresponding driver (
mysql2orpg) instead of or in addition tobetter-sqlite3as required. -
Register the module in
nuxt.config.tsexport default defineNuxtConfig({ modules: ['nuxt-users'] }) -
Run migrations From the project root (where
nuxt.config.tslives):npx nuxt-users migrate -
Create at least one user
npx nuxt-users create-user -e admin@example.com -n "Admin User" -p password123 -r adminFlags:
-eemail,-nname,-ppassword,-rrole (optional). -
Configure permissions
export default defineNuxtConfig({ modules: ['nuxt-users'], nuxtUsers: { auth: { permissions: { admin: ['*'], user: ['/profile', '/api/nuxt-users/me'] } } } }) -
Use login in a page
- Use the
NUsersLoginFormcomponent and handle@successby callinglogin(user)fromuseAuthentication(). - Optionally redirect after login (e.g.
navigateTo('/')).
- Use the
Configuration reference (nuxt.config.ts)
All options live under nuxtUsers in nuxt.config.ts.
| Area | Key | Notes |
|---|---|---|
| Database | connector.name | 'sqlite' | 'mysql' | 'postgresql' |
| Database | connector.options | path (SQLite), or host, port, user, password, database (MySQL/PostgreSQL) |
| API | apiBasePath | Default '/api/nuxt-users' |
| Tables | tables.users, tables.personalAccessTokens, tables.passwordResetTokens, tables.migrations | Custom table names |
| Mailer | mailer | Nodemailer config for password reset emails |
| URLs | passwordResetUrl, emailConfirmationUrl | Paths for redirects |
| Auth | auth.whitelist | Public routes (e.g. ['/register']); /login is always public |
| Auth | auth.tokenExpiration | Minutes (default 1440) |
| Auth | auth.rememberMeExpiration | Days (default 30) |
| Auth | auth.permissions | Role → paths (e.g. admin: ['*'], user: ['/profile']). Keys are the predefined roles. |
| Auth | auth.allowCustomRoles | Default false. When true, create/update APIs and NUsersUserForm accept roles not listed in permissions. Empty permissions (bootstrap) already accepts any role. |
| Auth | auth.google | Google OAuth: clientId, clientSecret, callbackUrl, etc. |
| Password | passwordValidation | minLength, requireUppercase, requireLowercase, requireNumbers, requireSpecialChars, preventCommonPasswords |
| Data | hardDelete | true = hard delete, false = soft delete (default) |
| Locale | locale.default, locale.texts, locale.fallbackLocale | Localization |
Runtime config is also supported: use runtimeConfig.nuxtUsers for env-based or server-only settings.
CLI commands
Run from the project root so nuxt.config.ts (and optionally .env) are found.
-
Migrations
npx nuxt-users migrate -
Create user
npx nuxt-users create-user -e <email> -n "<name>" -p <password> [-r <role>]Role should match a
auth.permissionskey unlessauth.allowCustomRolesistrue(or permissions are empty). -
Legacy/table creation
npx nuxt-users create-users-table npx nuxt-users create-personal-access-tokens-table npx nuxt-users create-password-reset-tokens-table npx nuxt-users create-migrations-table
Production: The CLI requires
nuxt-users(and peers) installed where Node runs — it is not bundled inside.output/. Full config needs the app root withnuxt.config; build-only or--omit=devdeploys fall back toDB_*env vars. Seedocs/user-guide/configuration.md.
Composables (auto-imported)
- useAuthentication() —
user,isAuthenticated,login(user, rememberMe?),logout(),fetchUser(useSSR?),initializeUser() - useUsers() — Admin:
users,pagination,loading,error,fetchUsers(page?, limit?),updateUser,addUser,removeUser(userId) - usePublicPaths() —
getPublicPaths(),getAccessiblePaths(),isPublicPath(path),isAccessiblePath(path, method?) - usePasswordValidation(moduleOptions?, options?) —
validate(password),isValid,errors,strength,score,clearValidation() - useNuxtUsersLocale() —
t(key, params?),currentLocale,fallbackLocale
Components
NUsersLoginForm— Login form; use@successto calllogin(user)fromuseAuthentication()NUsersLogoutLink— Logout link/buttonNUsersProfileInfo— Display profileNUsersResetPasswordForm— Password reset formNUsersList— List users (admin)NUsersUserForm— Create/edit user form; role select fromauth.permissionskeys; setauth.allowCustomRoles: truefor a custom free-text role option
Troubleshooting
| Symptom | Fix |
|---|---|
| Redirected to login on protected routes | Set auth.permissions so each role has access to needed routes |
| CLI config not found / wrong tables | Run CLI from the directory containing nuxt.config; see production note above |
| Migrations table missing | Run npx nuxt-users migrate from project root |
| Database driver errors | Install correct peer: SQLite → better-sqlite3, MySQL → mysql2, PostgreSQL → pg |
File references
- Project LLM context and config types: llms.txt in the repo root
- Full docs: https://nuxt-users.webmania.cc/
- Getting started and examples:
../../docs/user-guide/getting-started.md,../../docs/examples/basic-setup.md - Authorization:
../../docs/user-guide/authorization.md - Configuration details:
../../docs/user-guide/configuration.md
Keep nuxtUsers config and permissions in sync with the app’s roles and routes; use guard clauses and early returns when implementing custom auth logic.
FAQ
What does the nuxt-users skill do?
Configure and use the nuxt-users module for Nuxt. Use when adding authentication, user management, roles, password reset, database setup (SQLite/MySQL/PostgreSQL), or CLI commands (migrate, create-user). Covers nuxt.config (nuxtUsers), composables (useAuthentication, useUsers, usePublicPaths, usePasswordValidation, useNuxtUsersLocale), components (NUsersLoginForm, NUsersLogoutLink, etc.), and authorization (whitelist, permissions).
How do I install nuxt-users?
Run npx skills add https://github.com/onmax/nuxt-skills --skill nuxt-users in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/nuxt-users/ (personal) or .claude/skills/nuxt-users/ (project).
Which AI agents can use nuxt-users?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is nuxt-users safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains nuxt-users?
It is published by onmax in onmax/nuxt-skills. It has 194 recorded installs.
More from onmax/nuxt-skills
nuxt
onmax/nuxt-skills
Nuxt full-stack Vue framework with SSR, auto-imports, and file-based routing. Use when working with Nuxt apps, server routes, useFetch, middleware, or hybrid rendering.
vue
onmax/nuxt-skills
Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.
reka-ui
onmax/nuxt-skills
Use when building with Reka UI (headless Vue components) - provides component API, accessibility patterns, composition (asChild), controlled/uncontrolled state, virtualization, and styling integration. Formerly Radix Vue.
nuxt-ui
onmax/nuxt-skills
Build UIs with @nuxt/ui v4 — 125+ accessible Vue components with Tailwind CSS theming. Use when creating interfaces, customizing themes to match a brand, building forms, or composing layouts like dashboards, docs sites, and chat interfaces.
vitest
onmax/nuxt-skills
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
nuxt-seo
onmax/nuxt-skills
Nuxt SEO meta-module with robots, sitemap, og-image, schema-org. Use when configuring SEO, generating sitemaps, creating OG images, or adding structured data.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.