start-core/server-functions

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

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/cill-i-am/task-tracker --skill start-core-server-functions-cill-i-am
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: start-core/server-functions
Source: https://github.com/cill-i-am/task-tracker/tree/main/.agents/skills/tanstack-start-server-functions
Command: npx skills add https://github.com/cill-i-am/task-tracker --skill start-core-server-functions-cill-i-am

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Type-safe server-side RPCs enable TanStack Start apps to run server-only logic while still allowing calls from loaders, components, and other client-facing code, reducing risk and complexity.

Core Features & Use Cases

  • Type-safe RPCs created with createServerFn that run on the server but can be invoked from loaders, components, hooks, or other server functions.
  • Built-in input validation options (basic validators, Zod, FormData) and robust error handling (errors, redirects, notFound) with server context utilities (getRequest, getRequestHeader, setResponseHeaders, setResponseStatus).
  • Clear guidance for file organization and static imports, plus cross-references to related skills for deeper learning.

Quick Start

Create a server function with createServerFn and invoke it from a React component using useServerFn.

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?

Type-safe server functions in TanStack Start are created using the createServerFn utility, enabling server-only logic to be invoked from loaders, components, or hooks while maintaining full type safety.

What validation options are supported for TanStack Start server RPCs?

TanStack Start server RPCs support multiple input validation options, including basic validators, Zod schemas, and FormData, ensuring that inputs passed to createServerFn are strictly validated.

How does error handling work for server functions in TanStack Start?

Error handling for TanStack Start server functions includes built-in mechanisms for throwing errors, redirecting requests, and returning notFound responses, alongside server context utilities for managing HTTP status and headers.

Can I access request headers and set response status inside a TanStack Start server function?

Yes, server functions in TanStack Start provide server context utilities like getRequest, getRequestHeader, setResponseHeaders, and setResponseStatus to directly interact with HTTP request and response details.

When should I use server functions instead of standard API routes in TanStack Start?

Server functions are ideal when you need to run server-only logic invoked directly from client-facing code or loaders, reducing risk and complexity by providing type-safe RPCs rather than manually fetching standard API routes.

Do I need Zod to validate input for TanStack Start createServerFn?

No, Zod is not required; createServerFn supports basic validators and FormData for input validation, allowing you to choose the validation strategy that best fits your application's needs.