Server Actions
Use oRPC to improve your server actions.
Server Actions
Server actions allow you to use oRPC procedures directly as form handlers in frameworks that support server actions (like Next.js). They provide automatic type coercion and FormData handling out of the box.
Context Requirements
Server actions are automatically enabled for procedures that have either:
- No context requirements (
undefinedcontext) - Optional context (
Context | undefined)
Usage Examples
Define Server Action
Create type-safe server actions with full input validation:
Form Integration
Use with React forms and get automatic type coercion:
Direct Client Calls
Call server actions directly from client components: