Getting Started

Schema Generation

Auto-generate Drizzle tables from Better Auth plugins.

When Nuxt starts, the module:

  1. Loads your server/auth.config.ts to read plugins.
  2. Calls Better Auth’s getAuthTables({ plugins }).
  3. Generates a Drizzle schema file into .nuxt/better-auth/schema.<dialect>.ts.
  4. Extends the NuxtHub database schema with those tables.

Supported dialects are sqlite, postgresql, and mysql. The dialect is read from hub.db.

Notes

  • Regeneration happens on server start. Restart dev server after changing plugins.
  • If hub.db is not configured, schema generation is skipped (you’ll see a warning).

See also

  • Better Auth plugins (affects generated tables): /better-auth/plugins