What this thread does
As of November 2026, use UploadThing’s typed FileRouter and client upload components for hosted storage. Do first: identify your Tailwind major version before copying style setup; v3 and v4 use different configuration.
The problem
Direct-to-storage uploads can require a bucket, CORS, signed URLs, progress and metadata. Agents often generate a server action that receives the whole file, which hits body limits and ties up the server.
What the source says
- UploadThing SDKs are MIT licensed. The docs at docs.uploadthing.com (App Router guide) describe: install
uploadthingand@uploadthing/react; setUPLOADTHING_TOKENfrom the dashboard; define a FileRouter (for examplef({ image: { maxFileSize: "4MB", maxFileCount: 1 } }));.middleware(...)runs on the server before upload and throwingUploadThingErrorblocks it;.onUploadComplete(...)runs after upload; export routes withcreateRouteHandler; generateUploadButtonandUploadDropzonetyped with your router. - Tailwind v3 uses the
withUtconfig wrapper. For Tailwind v4 CSS configuration, importtailwindcssanduploadthing/tw/v4, then add an@sourcepointing at@uploadthing/react/dist; the path depends on your project structure (theming source, v3 and v4 tabs). The App Router guide also shows an optional SSR plugin in the root layout to avoid a loading state. - Note the trade: it is a hosted service plus an open SDK. Storage is theirs, so check pricing and data location for your case.
How to describe it to the agent
Suggested prompt:
Add avatar upload with UploadThing in this Next.js App Router project. Define one route with image only, max 4 MB, 1 file. In middleware check our existing session and throw UploadThingError if not signed in. In onUploadComplete save the file URL to the user row. Use UploadDropzone styled with our tokens. Never put UPLOADTHING_TOKEN in client code.
Common mistakes to check for
- Skipping the middleware, so anyone can upload.
- Trusting the client-side limit only (the route config is the real limit).
- Components used in a server component; they need
"use client". - Token committed to the repo.
Limits
The Next.js integration needs a server route. For authenticated uploads, add authentication middleware. The hosted-storage tradeoff remains; choose data location and service terms for your application.
Sources
Started from a post by @pingdotgg, packaged by the editor. Original post