ViteHub is still experimental. Expect bugs and breaking changes.

Introduction

Choose the ViteHub layer that matches the first thing you need to build.

ViteHub adds a server layer to Vite. Server Primitives give application code APIs for storage, background work, auth, and other server features. Agents combine those APIs with models, coding providers, or application code.

Agents can use Server Primitives. Server Primitives also work on their own. Start with the path that matches the result your product needs today.

Use a Server Primitive
Store a value in local KV and read it from a server route.
Run an Agent
Define an Agent and inspect the result of one invocation.

Choose a first path

Start with Server Primitives when application code needs auth, environment values, storage, files, background work, or isolated execution. Your server code calls the ViteHub API, and the Vite integration connects it to the selected provider.

Start with Agents when the product needs a named server-side actor. An Agent Definition puts its instructions, execution method, Capabilities, and Workspace in one file.

You want to buildStart here
Settings, feature flags, caches, cursors, or small recordsFirst Server Primitive
A support, coding, research, or workspace-aware actorFirst Agent
Relational data, uploads, background work, workflows, schedules, or sandboxesServer Primitives
Model-facing tools, guarded product abilities, or chat entry pointsCapabilities

What ViteHub does

Most features use the same path:

PartWhat it does
Vite integrationFinds definitions and prepares the selected provider during development and build.
DefinitionDeclares named work or state, such as an Agent, Workspace, Queue, Workflow, or Schedule.
Server APILets application code call a feature through an import such as kv, useWorkspace(), or runAgent().
CapabilityLets an Agent use a selected operation such as workspaceShell() or kv().

Application code uses ViteHub imports. The integration handles the provider-specific routes, bindings, and files.

Verify your setup

Check the ViteHub plugin in vite.config.ts, the definition file when the feature needs one, and the ViteHub call in server code. Each first guide ends with a response you can inspect before adding another feature.

Next steps