Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
1.5 KiB
1.5 KiB
@kit/next — Next.js Utilities
Non-Negotiables
- ALWAYS validate input with Zod schema via
.inputSchema() - ALWAYS use
authActionClientfor authenticated actions,publicActionClientfor public - ALWAYS use
useActionhook fromnext-safe-action/hookson the client side - ALWAYS use
revalidatePathafter mutations - NEVER use server actions for data fetching — mutations only
- NEVER put business logic in actions — extract to service files
- NEVER use
router.refresh()orrouter.push()after server actions - NEVER use
adminActionClientoutside admin features — useauthActionClient
Skills
/server-action-builder— Complete server action workflow
Quick Reference
| Function | Import | Purpose |
|---|---|---|
authActionClient |
@kit/next/safe-action |
Authenticated server actions |
publicActionClient |
@kit/next/safe-action |
Public server actions (no auth) |
captchaActionClient |
@kit/next/safe-action |
Server actions with CAPTCHA + auth |
enhanceRouteHandler |
@kit/next/routes |
API routes with auth + validation |
Exemplars
- Server action:
packages/features/accounts/src/server/personal-accounts-server-actions.ts - Route handler:
apps/web/app/[locale]/home/[account]/members/policies/route.ts - Client usage:
apps/web/app/[locale]/(marketing)/contact/_components/contact-form.tsx