Better Auth requires tables for users, sessions, accounts. This module creates them automatically with NuxtHub and Drizzle ORM.
The module analyzes your server/auth.config.ts at build time to determine which tables are required by your core configuration and enabled plugins (e.g., twoFactor, passkey).
plugins from your config.The module supports all dialects compatible with NuxtHub:
sqlite (Default)postgresqlmysqlEnsure you have configured the dialect in nuxt.config.ts:
export default defineNuxtConfig({
hub: {
db: {
dialect: 'postgresql' // or 'sqlite', 'mysql'
}
}
})
When you add a new plugin that requires database tables (e.g., adding twoFactor):
server/auth.config.ts.For local development, migrations run automatically when you start the dev server.
For production (Cloudflare D1):
npx nuxt db migrate