{"slug": "show-hn-turn-any-next-js-app-ai-native-in-5-minutes", "title": "Show HN: Turn any Next.js app AI native in 5 minutes", "summary": "BetterAgent launches a developer tool that turns any Next.js app into an AI-native application in minutes by reading routes and server actions to create an agent layer. The tool supports server actions, client actions, and API routes, and includes features like streaming, observability, and auth. It offers a free tier with 500 credits every 30 days and a starter plan at $0.99 per month.", "body_md": "# The agent layer your *SaaS* is missing.\n\nPoint BetterAgent at your codebase. It reads your routes and server actions - and now your users get an agent that does real work inside the product you already shipped.\n\n## Routes, server actions, client actions. Same protocol.\n\nThree primitives in your code; two messages on the wire. The agent *reads* data through routes, *mutates* through server actions, and *steers the UI* through client actions.\n\n``` js\n\"use server\";\n\nimport { defineServerAction } from \"betteragent-next\";\nimport { z } from \"zod\";\nimport { createCampaign } from \"@/app/actions\";\n\nexport const createCampaignAction = defineServerAction({\n  name: \"createCampaign\",\n  description: \"Draft a re-engagement campaign.\",\n  schema: z.object({ audienceId: z.string() }),\n  handler: createCampaign,\n});\n```\n\n### Server Action\n\nWrap an existing Next.js Server Action — the SDK dispatches the call so session and revalidation work as normal.\n\n[Read the docs](https://docs.betteragent.dev)\n\n## Your app already has tools.\n\nBetterAgent finds them.\n\nPoint the CLI at your codebase and we read your routes and server actions. You pick which handlers the agent can call and write the descriptions it uses to decide when.\n\n### betteragent discover\n\nWe walk your codebase: every Server Action, every API route, every exported handler. You pick which ones the agent can call.\n\n### Tool files scaffolded\n\nWe scaffold one entry per selected handler with an empty Zod schema you fill in. The agent gets the same contract your IDE has once you describe the arguments.\n\n### betteragent sync\n\nDiff against the server, confirm, ship. Routes are static at runtime — the LLM only sees the names and schemas you approved.\n\n## A shadcn-style registry of agent UI.\n\nPick a layout, run `betteragent add`\n\n, and you own the code. Theming inherits from your shadcn tokens.\n\n**create_campaign**\n\n**create_campaign**\n\n**create_campaign**\n\n## Debug like an HTTP request,\n\nnot a model.\n\nEvery conversation, every tool call, every token, all recorded and queryable.\n\n## Boring infrastructure for an exciting layer.\n\nStreaming, observability, billing, auth, rate-limits, evals. The unsexy stuff that decides whether your agent ships.\n\n### Auth that's already there\n\nForwards your end-user's bearer token to your APIs. No service accounts, no scope leaks.\n\n[[email protected]](/cdn-cgi/l/email-protection)campaigns:write\n\n### Native SSE streaming\n\nTool calls fire mid-stream. No polling, no batching.\n\n### Claude Sonnet 4.6\n\nDefault model. Hosted with cache hits at 10% of normal token cost.\n\n### Observable by default\n\nEvery run, every token, every tool call logged and queryable.\n\n### One protocol, Next.js today\n\nNext.js (App Router) is the only framework supported right now. Other adapters are planned, not yet available.\n\n### Rate limiting built in\n\nPer-project and per-IP limits enforced before requests hit your tools.\n\n## Free until your agent earns its keep.\n\n500 credits every 30 days on the house, free to prototype. Starter is $0.99/mo for 1,500 credits. No card required.\n\nFor prototyping and small projects.\n\n- 500 credits / 30 days\n- Unlimited projects\n- Hosted Sonnet 4.6\n\n3x the runway, for less than a pack of gum.\n\n- 1,500 credits / 30 days\n- Hard-capped, no surprise charges\n- Hosted Sonnet 4.6\n\nEvery plan is priced per project — create as many projects as you want.\n\n[Send us a message](/contact?topic=credits)\n\n## Stop describing what your app does.\n\nLet it do the work.\n\nFree forever for prototypes. Plug in your routes, drop in the components, ship a real agent before lunch.", "url": "https://wpnews.pro/news/show-hn-turn-any-next-js-app-ai-native-in-5-minutes", "canonical_source": "https://www.betteragent.dev/", "published_at": "2026-06-25 04:25:33+00:00", "updated_at": "2026-06-25 04:43:22.895688+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools", "ai-infrastructure", "large-language-models"], "entities": ["BetterAgent", "Next.js", "Claude Sonnet", "Zod", "shadcn"], "alternates": {"html": "https://wpnews.pro/news/show-hn-turn-any-next-js-app-ai-native-in-5-minutes", "markdown": "https://wpnews.pro/news/show-hn-turn-any-next-js-app-ai-native-in-5-minutes.md", "text": "https://wpnews.pro/news/show-hn-turn-any-next-js-app-ai-native-in-5-minutes.txt", "jsonld": "https://wpnews.pro/news/show-hn-turn-any-next-js-app-ai-native-in-5-minutes.jsonld"}}