AvalonAvalon
GitHub

Server Actions

Type-safe server functions defined with defineAction, validated with Zod, and callable from the client via a typed actions proxy that returns { data, error }.

actions.greet() — type-safe client call

subscribe — progressive form (no client JS)

This form posts directly to /_actions/subscribe. With JavaScript disabled, the server still validates the email and responds.

What to verify: Type a name and click Greet — DevTools Network shows a POST /_actions/greet returning { "data": { "message": ... } }. Clear the name to see a BAD_REQUEST validation error.