start-core/middleware

Official

Build type-safe middleware for TanStack Start.

AuthorTanStack
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Middleware in TanStack Start provides a cohesive approach to composing request processing, enabling shared context, policy enforcement, and predictable behavior across SSR, routes, and server functions.

Core Features & Use Cases

  • Request Middleware runs on all server requests (SSR, routes, functions) to log, validate, or modify requests.
  • Server Function Middleware runs on both client and server phases to enable pre/post processing and context injection.
  • Attach to Server Functions & Routes easily to enforce authentication, logging, or feature flags.
  • Context Passing uses next({ context }) to propagate data through the middleware chain to handlers.
  • Global Middleware configuration in src/start.ts for universal behavior across the app.

Quick Start

Create a middleware with createMiddleware and attach it to a server function to see contextual data flow.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: start-core/middleware
Download link: https://github.com/TanStack/router/archive/main.zip#start-core-middleware

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.