ViteHub is still experimental. Expect bugs and breaking changes.

Runtime Helpers and stable imports

Understand which imports application code uses to call ViteHub.

A Runtime Helper is the documented server API that application code uses to call or inspect a ViteHub feature. ViteHub keeps generated registries, provider bindings, and framework adapters behind that import.

The package page documents what the API returns and which host resources it needs.

Call the helper from server code

server/api/health.ts
import { useServerEnv } from '#vitehub/env/server'

export function health() {
  const env = useServerEnv()
  return { environment: env.APP_ENV }
}

Use the package import or generated #vitehub/... path documented for the feature. Don't import .vitehub registry files directly. The integration can change their structure.

Keep configuration and runtime code separate

PartWhat it contains
Runtime HelperThe application call or inspection API.
DefinitionNamed configuration and behavior in application code.
Runtime ContextHost resources needed during execution.
Provider OutputGenerated routes, bindings, functions, workers, or other host artifacts.

The Runtime Helper can use Runtime Context without making application code construct provider-specific objects.

Check an import failure

Check the package's documented import, the registered Vite integration, and the generated type files. Read Import paths for exact path rules and Provider Output for generated files.