Skip to content

Configuration

The module configuration lives under the feathers key in nuxt.config.ts.

ts
export default defineNuxtConfig({
  modules: ['nuxt-feathers-zod'],
  feathers: {
    client: { mode: 'embedded' },
    servicesDirs: ['services'],
  },
})

Main options

OptionPurpose
clientClient mode, transport and connection behavior.
serverEmbedded server activation and options.
servicesDirsDirectories scanned for services.
transportsREST and Socket.io.
authLocal/JWT authentication.
keycloakClient-side Keycloak and bridge settings.
databaseMongoDB configuration and management options.
validatorValidator used by schemas.
swaggerLegacy Swagger documentation.
consoleEmbedded console/builder when available.
devtoolsDevTools integration when available.

Runtime config

The module writes private and public configuration under _feathers.

  • runtimeConfig._feathers: private server values;
  • runtimeConfig.public._feathers: values available on the client.

Secrets must stay in private configuration or server-side environment variables.

Embedded MongoDB example

ts
export default defineNuxtConfig({
  modules: ['nuxt-feathers-zod'],
  feathers: {
    client: { mode: 'embedded' },
    servicesDirs: ['services'],
    transports: {
      rest: { enabled: true, path: '/feathers' },
      websocket: { enabled: true },
    },
    database: {
      mongodb: {
        enabled: true,
        url: process.env.MONGO_URL,
      },
    },
  },
})

Remote example

ts
export default defineNuxtConfig({
  modules: ['nuxt-feathers-zod'],
  feathers: {
    client: {
      mode: 'remote',
      url: 'https://api.example.com',
      transport: 'socketio',
    },
    auth: {
      enabled: true,
    },
  },
})

Best practice

Centralize environment values in .env files and never duplicate secrets in source code.

nuxt-feathers-zod module documentation