Agentoria

Deploy anywhere

createAgentHandler is a Fetch handler — it drops into almost every runtime as-is.

createAgentHandler returns a standard (Request) => Promise<Response>. On any Fetch-native runtime that is your handler — no adapter.

Next.js (App Router)

app/api/agent/route.ts
export const POST = createAgentHandler({ provider, tools });
export const runtime = 'nodejs'; // or 'edge'

Cloudflare Workers

src/index.ts
const agent = createAgentHandler({ provider, tools });
export default { fetch: agent };

Hono

const agent = createAgentHandler({ provider, tools });
app.post('/api/agent', (c) => agent(c.req.raw));

Deno / Bun

Deno.serve(createAgentHandler({ provider, tools }));   // Deno
Bun.serve({ fetch: createAgentHandler({ provider, tools }) }); // Bun

Node http / Express

These speak (req, res), not Fetch — bridge with @agentoria/node, which streams SSE chunk-by-chunk and cancels on client disconnect:

import { createServer } from 'node:http';
import { toNodeHandler } from '@agentoria/node';

const agent = createAgentHandler({ provider, tools });

createServer(toNodeHandler(agent)).listen(3000);
// Express: app.post('/api/agent', toNodeHandler(agent));

The client is identical everywhere — useAgentChat / <ChatPanel/> just POST to the endpoint and read the AgentEvent SSE stream.

On this page