Installation
Install the Vue Start package:Vite Plugin Setup
Configure the TanStack Start Vite plugin in yourvite.config.ts:
Router Setup
Create your router instance insrc/router.ts:
Server Functions
TanStack Vue 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 composable:
useServerFn composable 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 Vue Start provides several package exports:@tanstack/vue-start- Main client exports@tanstack/vue-start/server- Server-only utilities@tanstack/vue-start/client- Client-only utilities@tanstack/vue-start/plugin/vite- Vite plugin@tanstack/vue-start/server-rpc- Server RPC utilities@tanstack/vue-start/client-rpc- Client RPC utilities@tanstack/vue-start/ssr-rpc- SSR RPC utilities
Vue-Specific Features
Composition API
Leverage Vue’s Composition API with server functions:Suspense Support
Use Vue’s Suspense for async components:Server-Side Rendering
Vue Start provides optimized SSR with automatic hydration:Reactive State
Combine reactive state with server functions:TypeScript Configuration
Ensure yourtsconfig.json includes:
Peer Dependencies
TanStack Vue Start requires:- Vue >= 3.3.0
- Vite >= 7.0.0
Next Steps
Server Functions
Learn more about creating and using server functions
Routing
Explore TanStack Router features
Examples
Browse Vue Start examples
API Reference
View the complete API documentation