X Bookmarks — 2024 KW30: Server Actions as a composition layer in Next.js

July 25, 2024

|bookmarks

by Florian Narr

X Bookmarks — 2024 KW30: Server Actions as a composition layer in Next.js

@pontusab — composing Next.js Server Actions with instrumentation, auth, and context

Server Actions in @nextjs are now more powerful in @middayai, supporting:

  • Instrumentation with @getsentry 🐞
  • Auth guard 🔐
  • Analytics events 🎷
  • @supabase in context 🧱
  • User in context 👋

Smart, because this is exactly the composition problem Server Actions leave unsolved out of the box. You get the mechanism but not the middleware layer — and @pontusab is essentially building that layer inline. Sentry instrumentation + auth guard + analytics in a single wrapper means you stop reimplementing the same five lines in every action. Worth watching if you're scaling a Next.js app beyond a few dozen actions.