ViteHub is still experimental. Expect bugs and breaking changes.

Nitro and UnJS

Understand the narrow boundary between ViteHub, Nitro, and UnJS server runtimes.

ViteHub is not a Nitro module system. ViteHub uses Vite Integrations as the public integration layer, while package-owned Nitro wiring appears only where a host boundary needs generated runtime hooks.

Boundary

LayerViteHub expectation
VitePublic integration layer for discovery, generated files, DevTools, and Provider Output.
NitroHost runtime bridge when a package must register generated handlers, middleware, or runtime hooks.
UnJS librariesUseful implementation dependencies for server primitives, not public ViteHub framework identity.
Application server codeCalls Runtime Helpers and stable handlers without importing generated Nitro internals.

Accepted Nitro handoffs

BridgeStatusOwnerPurpose
Schedule Provider WakeAvailableSchedule PackageRegisters Cloudflare scheduled runtime hooks and cron output for Nitro-shaped hosts.
Workspace hosted runtime setupAvailable where hosted stores require itWorkspace PackageMoves generated Workspace runtime setup into Nuxt's top-level Nitro config.
Database Nuxt D1 host wiringAvailable for Nuxt D1 host resourcesDatabase PackageKeeps one D1 Database Host Resource in sync with Nuxt Content and Cloudflare output.
General Nitro-first integrationNot the public directionNot applicableViteHub keeps the public contract on Vite Integrations.

Current generated route output

Auth and Agent generated Nitro handlers exist in current package output, but the accepted public direction remains Vite-first. Treat them as generated Provider Output under domain review, not as a general Nitro Framework Integration or public @vite-hub/*/nitro authoring surface.
OutputCurrent ownerBoundary
Auth route handlerAuth PackageExposes generated /api/auth/** behavior while the Auth/Nitro boundary remains unresolved.
Agent chat and webhook routesAgent PackageDispatches generated Agent route output without making Nitro discovery or route files the app API.

Use stable handlers

Manual hosts should mount stable ViteHub handlers when a package exposes one. Generated Nitro files stay package-owned Provider Output.

server/auth.ts
import { defineAuth } from '@vite-hub/auth'

export default defineAuth({
  appName: 'Acme',
  database: true,
})
vite.config.ts
import { hubAuth } from '@vite-hub/auth/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    hubAuth(),
  ],
})

What not to do

Do not treat Nitro route files as the primary ViteHub API. If a package generates Nitro output, inspect it as Provider Output and keep application code on the package's Runtime Helpers or stable server handler.

Next steps

Copyright © 2026