Frameworks

Add Agentuity to a framework you already use, without replacing the router

Pick the framework you already chose. Keep its routes, middleware, logging, data layer, and build command. Agentuity adds service clients, local development, and deploy packaging on top of those conventions.

Framework Guides

Start with the framework that owns your routes and build command. Each guide keeps the framework conventions in place and adds Agentuity only at the server boundary.

Choose a Starting Point

PathUse whenStart with
Create a new Agentuity starterYou want Agentuity to scaffold one of the five built-in starters and example routes.npm create agentuity -- --framework nextjs --services keyvalue
Add Agentuity to a new framework appYou just created the app with the framework's own CLI.npm install -D @agentuity/cli and npm install @agentuity/keyvalue
Add Agentuity to an existing appThe app already has routes, scripts, env files, and a working build.Add Agentuity to an existing app

How the Framework Shape Works

Keep the framework's normal file conventions. Agentuity overlays service clients, dev environment wiring, and deploy metadata. It does not replace the router.

FrameworkRoute shapeAdd Agentuity through
Next.jsapp/api/**/route.tsstandalone service clients
Nuxtserver/api/*.ts Nitro handlersstandalone service clients
React Routerapp/routes.ts plus route modulesstandalone service clients
SvelteKit+server.ts routes and server actionsstandalone service clients
Astrosrc/pages/api/*.ts endpointsstandalone service clients
Hononew Hono() routesstandalone clients or @agentuity/hono
Vite + Reactbrowser UI with a server boundarystandalone service clients
TanStack Startserver routes and server functionsstandalone service clients

agentuity dev runs your package manager's dev script with service credentials when the linked project key is available. agentuity build runs the framework build, packages the app, and writes .agentuity/launch.json when packaging succeeds. Treat that as a packaging check, then validate the packaged command locally before relying on server routes.

Framework Starters

npm create agentuity -- --framework <slug> scaffolds these starters:

SlugFramework
nextjsNext.js
nuxtNuxt
sveltekitSvelteKit
astroAstro
honoHono

React Router, Vite + React, and TanStack Start are existing-framework adoption paths. Start with each framework's own CLI, then add @agentuity/cli, import the project, and verify agentuity build output before deploying.

Before You Deploy

CheckWhat it proves
upstream framework docsroute files, server handlers, adapters, and build output are idiomatic
local starter or appthe framework app runs before Agentuity packaging is involved
agentuity buildthe packaging step completes and writes .agentuity output
.agentuity/launch.json plus local validationthe packaged command starts the process and routes you expect

If a framework page calls out a detector fallback or packaging caveat, treat it as a deploy check: inspect the generated command and validate at least one server route before you ship it.

Add Services

Direct service clients are the portable default across supported frameworks. Use them in route handlers, server functions, workers, scripts, or CLIs that own the work:

npm install @agentuity/keyvalue
import { KeyValueClient } from '@agentuity/keyvalue';
 
const kv = new KeyValueClient();
await kv.set('sessions', 'current', { updatedAt: new Date().toISOString() });

Hono apps can also install @agentuity/hono when middleware is a convenient injection point for shared clients and telemetry. Direct clients still work in Hono when a route or module needs to stay framework-portable.

Next Steps

  • Services: choose storage, messaging, identity, observability, and execution clients
  • Build: model calls, streaming routes, and background work patterns
  • Deploying Apps: run your framework project with agentuity dev and agentuity deploy