server-functions

Build RPC-style server functions with createServerFn, Zod validation, and middleware.

1|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/oakoss/open-saas-kit --skill server-functions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: server-functions
Source: https://github.com/oakoss/open-saas-kit/tree/main/.claude/skills/server-functions
Command: npx skills add https://github.com/oakoss/open-saas-kit --skill server-functions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a clear pattern for building RPC-style server functions using createServerFn, enabling validators, middleware chains, and form action handlers to be composed safely and reused across a project.

Core Features & Use Cases

  • Typed server functions with input validation and strong data flow.
  • Middleware chaining for authentication, logging, and error handling.
  • Support for data fetching, mutations, and authenticated operations via a consistent request context.

Quick Start

Create a basic server function with a GET or POST method and a simple handler to validate input and return a result, then wire it into a route.

Frequently Asked Questions about server-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build typed RPC server functions with TanStack Start?

You can build typed RPC server functions using createServerFn, which enables validators, middleware chains, and form action handlers to be composed safely and reused across your project.

How do I validate input data in server functions using Zod?

To validate input data in server functions using Zod, createServerFn enforces input validation with Zod schemas, ensuring strongly typed data flow for your handlers before processing requests.

Can I use middleware chains for authentication in TypeScript server functions?

Yes, TypeScript server functions support middleware chaining for authentication, logging, and error handling, providing a structured request context for your authenticated mutation handlers.

What's the best way to handle form submissions and data fetching with server functions?

The best way to handle form submissions and data fetching is using createServerFn with GET or POST methods, attaching validators, and wiring the handler into your server routes.

Does createServerFn work for authenticated mutations across API surfaces?

Yes, createServerFn works for authenticated mutations by utilizing middleware chains and a structured request context, supporting secure data fetching and operations across server routes and API surfaces.

When should I not use server functions for data fetching?

You should avoid using createServerFn for data fetching when your project does not use TanStack Start or TypeScript, as the skill relies on these frameworks for RPC-style type enforcement and validation.