Deployment Scenarios — Agentuity Documentation

Deployment Scenarios

Deploy your frontend alongside agents or separately on Vercel, Netlify, etc.

Choose where your frontend lives based on your project needs.

All-in-One Deployment

Put your frontend code in src/web/ and deploy everything together:

my-project/
├── src/
│   ├── agent/
│   │   └── chat/
│   │       └── agent.ts
│   ├── api/
│   │   └── index.ts
│   └── web/
│       ├── App.tsx
│       ├── frontend.tsx
│       └── index.html
└── agentuity.json

When you run agentuity deploy, both your agents and frontend are bundled and deployed together.

// src/web/App.tsx
import { AgentuityProvider, useAPI } from '@agentuity/react';
 
function Chat() {
  const { invoke, data, isLoading } = useAPI('POST /api/chat');
  // ... your chat UI
}
 
export default function App() {
  return (
    <AgentuityProvider>
      <Chat />
    </AgentuityProvider>
  );
}

Best for:

  • New projects starting from scratch
  • Simple deployments with one codebase
  • Projects that don't need separate frontend scaling

Separate Frontend

Deploy your frontend on Vercel, Netlify, or any hosting platform while agents run on Agentuity:

Frontend (e.g., Vercel)                Agents (Agentuity)
┌───────────────────────┐           ┌───────────────────────┐
│     your-app.com      │ ────────► │    project.cloud      │
│     React/Next.js     │           │     Agent routes      │
└───────────────────────┘           └───────────────────────┘
// In your React app
import { AgentuityProvider, useAPI } from '@agentuity/react';
 
export default function App() {
  return (
    <AgentuityProvider baseUrl="https://your-project.agentuity.cloud">
      <YourApp />
    </AgentuityProvider>
  );
}

Best for:

  • Existing projects adding AI agents
  • Teams with separate frontend and backend deployments

CORS Configuration

When your frontend and agents are on different domains, configure CORS in app.ts:

// app.ts
import { createApp } from '@agentuity/runtime';
 
const { server, logger } = await createApp({
  cors: {
    origin: ['https://your-frontend.com', 'http://localhost:3000'],
    allowMethods: ['GET', 'POST', 'PUT', 'DELETE'],
    allowHeaders: ['Content-Type', 'Authorization'],
  },
});
 
logger.debug('Running %s', server.url);

Comparison

AspectAll-in-OneSeparate Frontend
DeploymentSingle agentuity deployDeploy frontend and agents separately
ConfigurationMinimalRequires baseUrl and CORS
ScalingTied togetherIndependent scaling
Best forNew projectsExisting frontends

Next Steps