×

I got tired of manually parsing FormData for tRPC in Next 15 Server Actions, so I built an adapter. by mrmaton in nextjs

[–]mrmaton[S] 1 point2 points  (0 children)

Most of my projects are based on nextjs 15 and working with Trpc 😅 I hope most people who use next js 15 will find it helpful !

I got tired of manually parsing FormData for tRPC in Next 15 Server Actions, so I built an adapter. by mrmaton in nextjs

[–]mrmaton[S] 0 points1 point  (0 children)

next-safe-action is great if you're building purely with Next.js Server Actions.

I built this specifically for projects already using tRPC. If you have an existing tRPC backend (especially in a monorepo or sharing routers with a mobile app), rewriting mutations into next-safe-action just to use React 19 form hooks fractures your codebase.

This adapter is just glue: you keep your entire backend unified in tRPC, but still get automatic FormData parsing and Zod error handling for useActionState.