start-core/server-functions

Implement type-safe server-side RPCs with createServerFn for TanStack Start.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/abereghici/skills --skill start-core-server-functions-abereghici
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: start-core/server-functions
Source: https://github.com/abereghici/skills/tree/main/vendor/tanstack-router/packages/start-client-core/skills/start-core/server-functions
Command: npx skills add https://github.com/abereghici/skills --skill start-core-server-functions-abereghici

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers need a type-safe, server-only RPC mechanism that can be called from loaders, components, or other server code.

Core Features & Use Cases

  • Type-safe RPC creation via createServerFn
  • Client-to-server calls from components using useServerFn
  • Input validation (including Zod) and error handling
  • Server context utilities (getRequest, getRequestHeader, setResponseHeader, setResponseStatus)
  • File organization patterns and server-only logic separation (e.g., .functions.ts, .server.ts)

Quick Start

Install TanStack Start, import createServerFn, define a simple GET server function, and invoke it from a client.

Frequently Asked Questions about start-core/server-functions

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

FAQPage Schema
How do I create type-safe server functions in TanStack Start?

You create type-safe server functions using createServerFn, which enables secure calls directly from loaders, components, or other server-side code in TanStack Start.

How do I validate input and handle errors in TanStack Start server functions?

Input validation and error handling in TanStack Start server functions can be implemented using Zod schemas alongside robust error throwing, redirect utilities, and notFound responses.

Can I access request headers and manage server context in TanStack Start RPCs?

Yes, server context utilities like getRequest, getRequestHeader, setResponseHeader, and setResponseStatus allow you to access and manage request and response data within TanStack Start RPCs.

What is the conventional file organization for separating server-only logic in TanStack Start?

Conventional file organization for server-only logic in TanStack Start uses .functions.ts and .server.ts extensions to generate static RPC stubs for client builds.

Do TanStack Start server functions support streaming and FormData handling?

Yes, TanStack Start server functions support both streaming responses and FormData handling, allowing flexible data transmission between the client and server.