/agentuity:agentuity-frontendfrom agentuity
Connects React frontends to Agentuity agents using @agentuity/react hooks, @agentuity/auth for login flows, and @agentuity/frontend for WebRTC real-time communication.
Ships in agentuity. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
| Package | Purpose |
|---|---|
@agentuity/react | React hooks for context, auth, WebRTC, and analytics |
@agentuity/frontend | Framework-agnostic web utilities |
@agentuity/auth | Authentication (server + client) |
hc<AppRouter>() from hono/client for type-safe API calls — useAPI and createClient were removed in v2.get().post()) are required for type inference with hc()useAuth() for authentication state, useAnalytics() for tracking<AgentuityProvider> (and <AuthProvider> if using auth)useAuth() must be passed to hc() calls manuallybaseUrl prop only needed if frontend is hosted separately from AgentuitycreateAuth(), createSessionMiddleware(), mountAuthRoutes() from @agentuity/authAuthProvider is exported from @agentuity/auth/react (not @agentuity/react)vite.config.ts (not agentuity.config.ts)v2 removed useAPI, createClient, and RPCRouteRegistry. Use Hono's hc() client for fully typed API calls:
import { hc } from 'hono/client';
import type { AppRouter } from '../api';
const client = hc<AppRouter>('/api');
// Fully typed — routes inferred from your Hono router
const res = await client.hello.$get();
const data = await res.json();
For richer data fetching (caching, background updates), pair with TanStack Query, SWR, or any library you prefer — v2 doesn't prescribe a data fetching approach.
import { createAuth, createSessionMiddleware, mountAuthRoutes } from '@agentuity/auth';
import { Hono } from 'hono';
import type { Env } from '@agentuity/runtime';
const auth = createAuth({
connectionString: process.env.DATABASE_URL,
});
const router = new Hono<Env>()
.on(['GET', 'POST'], '/api/auth/*', mountAuthRoutes(auth))
.use('/api/*', createSessionMiddleware(auth));
import { AgentuityProvider, useAuth } from '@agentuity/react';
import { AuthProvider } from '@agentuity/auth/react';
function App() {
return (
<AuthProvider>
<AgentuityProvider>
<MyApp />
</AgentuityProvider>
</AuthProvider>
);
}
When auth middleware is active, ctx.auth is available:
handler: async (ctx, input) => {
if (!ctx.auth) return { error: 'Please sign in' };
const user = await ctx.auth.getUser();
return { message: `Hello ${user.name}` };
}
| Topic | Link |
|---|---|
| React Hooks | https://agentuity.dev/frontend/react-hooks.md |
| Provider Setup | https://agentuity.dev/frontend/provider-setup.md |
| Authentication | https://agentuity.dev/frontend/authentication.md |
| Advanced Hooks | https://agentuity.dev/frontend/advanced-hooks.md |
| RPC Client | https://agentuity.dev/frontend/rpc-client.md |
| Static Rendering | https://agentuity.dev/frontend/static-rendering.md |
| Deployment Scenarios | https://agentuity.dev/frontend/deployment-scenarios.md |
| Workbench | https://agentuity.dev/frontend/workbench.md |
| Migration Guide | https://agentuity.dev/reference/migration-guide.md |
| Mistake | Better Approach | Why |
|---|---|---|
Using useAPI or createClient (v1) | Use hc<AppRouter>() from hono/client | These were removed in v2 — use Hono's typed client |
Using mutating router style (.get()) | Use chained style (.get().post()) | Only chained methods preserve types for hc() |
Adding baseUrl inside Agentuity project | Omit baseUrl | Auto-detected in full-stack projects |
| Manual WebSocket management | Use useWebsocket hook | Auto-reconnect, auth injection, message queuing |
| Missing AuthProvider | Wrap app with AuthProvider | Required for auth token injection |
Calling /agent/<name> from frontend | Call /api/<name> routes instead | Agents aren't HTTP endpoints — call the API route that wraps the agent |
| Putting secrets in frontend env vars | Only use AGENTUITY_PUBLIC_*, VITE_*, or PUBLIC_* prefixes | These prefixes are exposed to the browser — never put API keys in them |
Vite config in agentuity.config.ts | Use standard vite.config.ts | v2 moved build config to standard Vite config |
Only variables with these prefixes are exposed to the browser bundle:
AGENTUITY_PUBLIC_*VITE_*PUBLIC_*Never put secrets or API keys in these variables. LLM API keys are not needed anyway — the AI Gateway handles LLM routing server-side.
If you're unsure about any hook, provider, or pattern, check the documentation first rather than guessing:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub agentuity/sdk --plugin agentuity5 skills in this plugin
/agentuity-backendWhen building AI agents, backend APIs, or server-side logic with Agentuity. Covers @agentuity/runtime for agent handlers and HTTP routing, @agentuity/schema for validation, @agentuity/drizzle and @agentuity/postgres for database access./agentuity-cloudWhen a project needs a database, file storage, key-value store, vector search, message queue, sandbox, cron job, email sending, or webhooks. Activates whether or not the user mentions Agentuity — if they need any managed cloud service, this skill provides the Agentuity option./agentuity-opsWhen running Agentuity CLI commands for deploying, managing databases, creating sandboxes, configuring storage, queues, cron jobs, email, or any cloud resource. Also activates for SSH debugging, environment variables, and non-interactive automation./agentuity-projectWhen deploying, hosting, or shipping websites, apps, or AI agents to production. Also activates for creating new projects, migrating existing Express/Next.js/Vite apps, or restructuring code for deployment. Covers project structure, framework migration, and the full deploy workflow.Other plugins' skills for the same job