Installation
Install the required dependencies:Configuration
Configuration Options
Properties
bindings: Cloudflare bindings (KV, R2, D1, etc.)entrypoint: Worker entrypoint path- Default:
dist/server/index.js
- Default:
assets: Static assets directory- Default:
dist/client
- Default:
wrangler.main: Path to server entry point- Default:
src/server.ts(if exists), otherwise uses@tanstack/react-start/server-entry
- Default:
compatibility: Node.js compatibility mode- Default:
"node"
- Default:
noBundle: Skip bundling- Default:
true
- Default:
Accessing Bindings
Access Cloudflare bindings in your TanStack Start application:Server Functions
API Routes
Loaders
TypeScript Configuration
Define types for your Cloudflare bindings:Local Development
Start the TanStack Start dev server:- Local emulation of Cloudflare bindings
- Hot module replacement
- Fast refresh
Custom Dev Configuration
Server Entry Point
The resource automatically detects your server entry point:- If
src/server.tsexists, it will be used - Otherwise, falls back to
@tanstack/react-start/server-entry
Custom Server Entry
Specify a custom server entry:Node.js Compatibility
TanStack Start automatically enables Node.js compatibility:- Node.js built-in modules
- npm packages with Node.js dependencies
- Full TanStack Start feature set
Deployment Best Practices
- Keep
dist/directory in.gitignore - Use environment variables for secrets via
alchemy.secret.env.X - Test locally with Vite dev server
- Configure proper TypeScript types for bindings
- Use server functions for data fetching
Related Resources
- Website - Base resource for web applications
- Worker - Cloudflare Workers deployment
- KV Namespace - Key-value storage
- D1 Database - SQL database