wervt
API

Module

@wervt/nuxt options and what the module sets up.
nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@wervt/nuxt'],
  wervt: {
    app: 'todos', // defaults to the package.json name
    timezone: 'Europe/Berlin', // of nitro.scheduledTasks, UTC by default
    dev: {
      adminUrl: 'postgres://postgres:postgres@localhost:5432/wervt',
      dbSecret: 'dev-secret',
      electricUrl: 'http://localhost:3030',
      electricSecret: 'dev-electric-secret',
    },
  },
})

All options are optional; the defaults match the wervt compose.yml. The dev values can also come from WERVT_PG_ADMIN_URL, WERVT_DB_SECRET, ELECTRIC_URL and ELECTRIC_SECRET.

What it does

BuildSets the deno-server Nitro preset for production builds.
RuntimeInjects Buffer, setImmediate and clearImmediate from Node builtins, which Deno doesn't define globally.
ClientAuto-imports useShape.
DevCreates the app's role and schema, runs migrations (again when drizzle/ changes) and sets DATABASE_URL and the Electric env vars.
LogsSets up evlog: one wide event per request, useLogger(event) and log.
TasksTurns on Nitro tasks; production builds hand nitro.scheduledTasks to wervt (see Tasks).
FilesWith ablage installed, connects it to the app's bucket, in dev too (see Files).

Exports

Import
@wervt/nuxt/serveruseDb, proxyShape, validation helpers, useWervtUser, useLogger, log, defineTask
@wervt/nuxt/provisionprovisionDatabase, appDatabaseUrl, dbRole, storageCredentials, createStorage (Node, used by the control plane and nuxt dev)
Copyright © 2026