nuxt-feathers-zod
| Install | |
|---|---|
npm install nuxt-feathers-zod |
|
| Latest Version: | 6.9.2 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 18, 2026 |
| Links: | GitHub · npm |
nuxt-feathers-zod
nuxt-feathers-zod integrates FeathersJS v5 (Dove), Zod schemas and typed service access into Nuxt 4.
It is designed for applications that need a real backend contract inside a Nuxt project, while keeping the option to connect to an external Feathers API.
Current reference version: 6.9.2.
Runtime baseline for 6.9.0: Node.js ^22.19.0 || ^24.11.0 || >=26.0.0 and Bun >=1.3.6 (release validation is recommended with Bun 1.3.14).
The embedded Nitro bridge uses @vevedh/feathers-nitro@0.6.0 with FeathersJS 5.0.49, Nuxt 4.5.2 and Vue 3.5.42; Nitro 2.13.4 and H3 1.15.11 remain deliberately frozen on this train.
What the module provides
- Embedded Feathers server mounted in Nuxt/Nitro.
- Remote Feathers client mode for an existing backend.
- Service generation through the CLI, including portable
objectid, UUID, integer, decimal-string bigint and string identifier strategies. - Zod-first schemas, resolvers, query validation and TypeScript types.
- Extensible local, JWT, OIDC, API-key and custom authentication provider registry, plus Keycloak-oriented remote flows.
- REST and Socket.io transports.
- Named MongoDB and Knex connections (PostgreSQL, MySQL, MariaDB, SQLite and Microsoft SQL Server), with explicit SQL drivers, safe pool defaults, single-connection transaction helpers, redacted diagnostics, and optional MongoDB management endpoints. MongoDB, PostgreSQL, MySQL, MariaDB, SQLite and MSSQL are certified by exact-candidate real-engine gates; MSSQL certification uses SQL Server 2025 with
tedious, an isolated database/schema, and candidate-bound teardown evidence. - Native server cache (
feathers.cache) withmemoryand native distributedredisproviders, Redis/Valkey compatibility, TTL, namespaces, fail-open behavior, process-local single-flightgetOrSet, and redacted diagnostics. Distributed diagnostics never scan the keyspace implicitly. - Feathers-first Builder and diagnostic services under
nfz/*. - Runtime composables for client, service, authentication and protected service access.
- VitePress documentation in French and English.
Installation
bun add nuxt-feathers-zod
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-feathers-zod'],
feathers: {
client: { mode: 'embedded' },
servicesDirs: ['services'],
transports: {
rest: { enabled: true, path: '/feathers' },
websocket: { enabled: true },
},
auth: {
providers: {
local: {
type: 'local',
usernameField: 'email',
passwordField: 'password',
},
jwt: { type: 'jwt' },
},
},
},
})
Recommended initialization
Use the official CLI instead of creating service folders manually.
bunx nuxt-feathers-zod init embedded --auth --framework express
bunx nuxt-feathers-zod add service users --auth --adapter mongodb --schema zod
bunx nuxt-feathers-zod add service articles --adapter mongodb --schema zod
bunx nuxt-feathers-zod doctor
The CLI writes a service manifest under services/.nfz/manifest.json, generates the service files and keeps the expected module conventions aligned with the runtime scanner.
Examples
The repository now contains a small progression of maintained examples in examples/:
minimal-embedded-memory— smallest embedded Feathers + Zod example, no database;nfz-quasar-unocss-pinia-starter— complete Nuxt 4 + Quasar 2 + Pinia + MongoDB + local-auth starter;real-world-nuxt4-daisyui-pinia-redis— Nuxt 4 + DaisyUiKit + Pinia + MongoDB + local/JWT + RBAC + native Redis/Valkey cache integration;remote-rest-minimal— remote REST client for an existing Feathers backend;sql-knex-named-connections— PostgreSQL/MySQL/MariaDB named-connection recipe;- Keycloak/LDAP SPA and SSR reference applications for SSO integration.
Start with examples/README.md to choose the smallest relevant path.
Runtime usage
<script setup lang="ts">
const articles = useService('articles')
const { data } = await useAsyncData('articles', async () => {
return await articles.find({
query: { $limit: 20, $sort: { createdAt: -1 } },
})
})
</script>
<template>
<pre>{{ data }}</pre>
</template>
Authentication is exposed through useAuth() and useAuthRuntime().
const auth = useAuth()
await auth.authenticate({
strategy: 'local',
email: 'admin@example.local',
password: '<user-password>',
})
Builder and diagnostic services
Enable the console to register the internal Feathers services used for schema inspection, previews, manifests and RBAC:
feathers: {
console: {
enabled: true,
allowWrite: false,
legacyNitroRoutes: false,
},
}
const builder = useBuilderClient()
const schema = await builder.getSchema('articles')
const databases = await builder.getDatabaseConnections()
The legacy /api/nfz/** routes are optional compatibility facades. New code should use useBuilderClient() or client.service('nfz/...').
Embedded and remote modes
Embedded mode
Use embedded mode when the Nuxt application owns the backend.
The Feathers application is created inside the Nuxt/Nitro server layer, services are scanned from servicesDirs, and the Nuxt app can expose both REST and Socket.io transports.
Remote mode
Use remote mode when the backend is already hosted elsewhere. The Nuxt app initializes a Feathers client, connects to the configured backend URL and can still use the same composables for service access.
bunx nuxt-feathers-zod init remote --url https://api.example.com --transport socketio --auth
Documentation
The documentation is available in the docs/ directory and is structured around:
- developer onboarding;
- CLI reference;
- configuration reference;
- runtime composables;
- services and hooks;
- authentication;
- production readiness.
Run it locally with:
cd docs
bun install
bun run dev
Production checklist
Before publishing or deploying an application using this module:
- Run
bunx nuxt-feathers-zod doctor. - Verify
feathers.servicesDirsand the generatedservices/.nfz/manifest.json. - Validate provider names, OIDC issuer/audience values and API-key scopes.
- Configure
NFZ_AUTH_SECRETor asymmetric signing keys; production startup rejects unsafe defaults. - Disable destructive MongoDB management actions unless explicitly required.
- Build the app and run at least one smoke scenario for authentication and one protected service.
License
MIT
Related Packages
A comprehensive user management module for Nuxt applications with authentication...
FeathersJS integration for Nuxt/Nitro with Express, Koa, Socket.IO, and multi-in...
Auto-generate Nitro defineRouteMeta (OpenAPI) for Nuxt server routes from JSDoc...
Version History
| Version | Released | License |
|---|---|---|
| 6.9.2 | MIT | |
| 6.9.1 | MIT | |
| 6.9.0 | MIT | |
| 6.8.0 | MIT | |
| 6.7.51 | MIT | |
| 6.7.45 | MIT | |
| 6.7.37 | MIT | |
| 6.6.2 | MIT | |
| 6.6.1 | MIT | |
| 6.6.0 | MIT | |
| 6.5.49 | MIT | |
| 6.5.30 | MIT | |
| 6.5.29 | MIT | |
| 6.5.28 | MIT | |
| 6.5.26 | MIT | |
| 6.5.20 | MIT | |
| 6.5.11 | MIT | |
| 6.5.1 | MIT | |
| 6.5.0 | MIT | |
| 6.4.138 | MIT | |
| 6.4.137 | MIT | |
| 6.4.136 | MIT | |
| 6.4.135 | MIT | |
| 6.4.133 | MIT | |
| 6.4.129 | MIT | |
| 6.4.128 | MIT | |
| 6.4.125 | MIT | |
| 6.4.121 | MIT | |
| 6.4.120 | MIT | |
| 6.4.119 | MIT |
Showing the latest 30 of 66. See every release on npm