tanstack-start

Generates full-stack TanStack Start apps on Cloudflare Workers with SSR, D1, and better-auth.

1|Updated Aug 18, 2026
One-click install
npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill tanstack-start-scsm-unrestrict
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-start
Source: https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent/tree/main/frontend-engineer/skills/tanstack-start
Command: npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill tanstack-start-scsm-unrestrict

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scaffolding a full-stack TanStack Start application on Cloudflare Workers involves many error-prone configuration details — Vite plugin ordering, wrangler bindings, D1 migrations, and per-request auth setup — where small mistakes cause cryptic build or runtime failures. ## Core Features & Use Cases - Complete project generation: Creates every file from scratch including routes, server functions, Drizzle schema, auth config, and shadcn/ui components — no template clone. - Auth and database wiring: Sets up better-auth (Google OAuth and email/password) with D1 + Drizzle, including per-request client patterns and API catch-all routes. - Deployment workflow: Covers local verification, secret management via wrangler, remote D1 migrations, and production deploy checklists. - Use Case: Ask for an SSR dashboard with login and CRUD on Cloudflare Workers, and receive a working React 19 + TanStack Start project with auth, database, theme toggle, and deployment steps. ## Quick Start Scaffold a full-stack TanStack Start app on Cloudflare Workers with D1, better-auth, and shadcn/ui for a project named my-dashboard.

Frequently Asked Questions about tanstack-start

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a full-stack TanStack Start app on Cloudflare Workers?

Create the project files from scratch: configure vite.config.ts with the cloudflare plugin first, set wrangler.jsonc main to @tanstack/react-start/server-entry, then add routes, server functions, D1 with Drizzle, and better-auth. Deploy with wrangler after running remote D1 migrations.

How do I set up better-auth with TanStack Start and D1?

Create a getAuth() factory using the Drizzle adapter with the D1 binding, and call it per-request rather than at module level. Expose it through an API catch-all route using createAPIFileRoute at /api/auth/$, not a server function, since better-auth needs direct request/response access.

Why is env undefined in my Cloudflare Workers server function?

The env object is undefined when accessed at module level because bindings only exist during request handling. Import env from cloudflare:workers and access it inside the request handler, creating the Drizzle client per-request.

Does TanStack Start on Cloudflare support Google OAuth?

Yes, better-auth supports Google OAuth via socialProviders with GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET secrets. You must add the production callback URL https://your-worker.workers.dev/api/auth/callback/google in Google Cloud Console.

Why does my TanStack Start build fail on Cloudflare?

Build failures usually come from wrong Vite plugin order or wrangler misconfiguration. Plugins must be ordered cloudflare, tailwindcss, tanstackStart, viteReact, and wrangler.jsonc needs the nodejs_compat compatibility flag with main set to the TanStack server entry.

Why do I get auth redirect loops after deploying?

Redirect loops happen when BETTER_AUTH_URL does not exactly match the deployed URL, including protocol and no trailing slash. Also set TRUSTED_ORIGINS with all valid URLs and redeploy after updating secrets, since wrangler secret put does not redeploy.