Installation
Install the Solid Start package:Vite Plugin Setup
Configure the TanStack Start Vite plugin in yourvite.config.ts:
Router Setup
Create your router instance insrc/router.tsx:
Server Functions
TanStack Solid Start provides server functions for executing code on the server with full type safety.Creating Server Functions
UsecreateServerFn to define server-side logic:
Using Server Functions in Components
Call server functions using theuseServerFn hook:
useServerFn hook automatically handles:
- Type-safe function calls
- Redirect responses from server functions
- Integration with TanStack Router navigation
Middleware
Add middleware to server functions for shared logic like authentication, logging, or data validation.Creating Middleware
Using Middleware in Server Functions
Input Validation
Validate server function inputs with validators like Zod, Valibot, or ArkType:HTTP Methods
Server functions support both GET and POST methods:Client and Server Contexts
Share context between client and server:Package Exports
TanStack Solid Start provides several package exports:@tanstack/solid-start- Main client exports@tanstack/solid-start/server- Server-only utilities@tanstack/solid-start/client- Client-only utilities@tanstack/solid-start/plugin/vite- Vite plugin@tanstack/solid-start/server-rpc- Server RPC utilities@tanstack/solid-start/client-rpc- Client RPC utilities@tanstack/solid-start/ssr-rpc- SSR RPC utilities
Solid-Specific Features
Reactive Primitives
Leverage Solid’s reactive primitives with server functions:Streaming with Suspense
Use Solid’s Suspense for streaming SSR:Server-Side Rendering
Solid Start provides optimized SSR out of the box:TypeScript Configuration
Ensure yourtsconfig.json includes:
Peer Dependencies
TanStack Solid Start requires:- Solid.js >= 1.0.0
- Vite >= 7.0.0
Next Steps
Server Functions
Learn more about creating and using server functions
Routing
Explore TanStack Router features
Examples
Browse Solid Start examples
API Reference
View the complete API documentation