Introducing a new way to review your PRs.

Read the announcement

pingdotgg / uploadthing

File uploads for modern web devs

View on GitHub

19 documents · Updated Oct 2, 2026

docs / frameworks-sdks

Framework SDKs

UploadThing provides client integrations for Vue, Solid, Svelte, Nuxt, and Expo. Each integration presents upload controls or helpers in the style of its host framework while using the same typed file-router endpoint, route settings, upload events, and result shape.

Integration model

The framework SDKs separate the user interface from the upload service. A developer supplies a FileRouter type and an endpoint name. The SDK then reads that endpoint's rules and sends the selected files to the configured UploadThing API route through the shared client uploader. Vue, Solid, and Svelte expose both ready-made controls and a lower-level helper for custom controls. Nuxt adds the server route and auto-import wiring that a Nuxt app needs. Expo adapts device pickers to the same upload helper.

The route contract is the shared boundary. A route defines the accepted file kinds, size and count limits, optional input, and server result. The client uses that contract to guide selection and to type endpoint input and completion data. This keeps a button, a dropzone, a custom file input, and a mobile picker aligned with the same server route.

The diagram shows how each framework-specific entry point joins the common route and upload lifecycle.

flowchart LR
    R[Typed FileRouter endpoint] --> M[Route metadata and rules]
    M --> C[Framework control or helper]
    C --> S[Select or prepare files]
    S --> N[Negotiate upload]
    N --> U[Transfer files]
    U --> O[Client result and server completion]
    C -. Vue .-> V[Vue SDK]
    C -. Solid .-> So[Solid SDK]
    C -. Svelte .-> Sv[Svelte SDK]
    C -. Nuxt .-> Nu[Nuxt module]
    C -. Expo .-> E[Expo pickers]

Shared upload lifecycle

All supported integrations preserve the same stages. The framework changes how state is exposed and how a user selects files. It does not change the endpoint contract or the meaning of the upload callbacks.

  1. The client resolves the API URL and identifies a typed endpoint.
  2. The client obtains the endpoint rules so the UI can allow the right file types and quantity.
  3. The user selects, drops, pastes, or picks files. A pre-upload callback can adjust the files.
  4. The client asks the UploadThing route for upload details and then transfers the files.
  5. Progress and upload-start events update the host framework's state.
  6. Completion returns typed file data. Errors use the shared UploadThing error model. An abort remains distinct from a normal upload error.

The helper options form the common lifecycle surface across the web SDKs and Expo. They cover file preparation, upload start, progress, completion, failure, request headers, and cancellation. Ready-made controls add selection behavior and usually own their abort control. Lower-level helpers return the upload action and reactive uploading state so an application can build its own interface.

References: packages/…/client.ts• L86-177 packages/…/types.ts• L94-164 packages/…/useUploadThing.ts• L58-157 packages/…/create-uploadthing.ts• L44-140 packages/…/create-uploadthing.ts• L35-136

Framework integration surfaces

Each package maps the common lifecycle to the state and composition model of its framework. These surfaces are intentionally parallel: generated helpers bind the router type and API settings, while components handle common file-selection patterns.

FrameworkIdiomatic entry pointsSelection modelShared contract
Vue SDKgenerateVueHelpers, UploadButton, UploadDropzoneFile input, dropzone, and optional paste supportTyped endpoint, route rules, lifecycle callbacks, and reactive upload state
Solid SDKgenerateSolidHelpers, generated buttons, dropzones, and uploaderFile input and dropzone controlsTyped endpoint, route rules, lifecycle callbacks, and Solid signals
Svelte SDKgenerateSvelteHelpers, UploadButton, UploadDropzone, and UploaderFile input and dropzone controlsTyped endpoint, route rules, lifecycle callbacks, and Svelte stores
Nuxt SDKNuxt module, auto-imported useUploadThing, and registered componentsVue controls or custom Nuxt UIA Nuxt server route backed by the app's file router and the Vue client surface
Expo SDKgenerateReactNativeHelpers, useImageUploader, and useDocumentUploaderImage library, camera, and document pickerTyped endpoint, route rules, lifecycle callbacks, and native asset conversion

Route configuration and client behavior

Route metadata connects server policy to client behavior. The web controls use it to set accepted MIME types and whether multiple files are allowed. Expo uses the same information to set image or document picker filters and selection count. The server remains the authority, so client filtering improves the user experience but does not replace route checks.

The API URL and fetch function are configurable across the integrations. This supports a relative application route in a browser and a host-aware or custom request path in mobile or server-rendered environments. Nuxt supplies the route automatically at /api/uploadthing, while Expo resolves a relative route from the running app's origin or its configured server origin.

References: packages/…/button.tsx• L109-165 packages/…/dropzone.tsx• L132-216 packages/…/index.tsx• L16-72 packages/…/types.ts• L20-50 packages/…/module.ts• L38-113 packages/…/uploadthing.ts• L17-25 packages/…/index.ts• L13-84 packages/…/image-picker.ts• L15-46 packages/…/document-picker.ts• L15-54

Framework-specific boundaries

The child pages describe the behavior of each integration in more detail. Use them when the general model is clear but the host framework's component, state, server, or device boundary needs review.

Web framework packages

The Vue, Solid, and Svelte packages provide matching button, dropzone, and custom-upload paths. Their main difference is the state model: Vue uses refs and computed values, Solid uses signals, and Svelte uses stores. Their endpoint types and lifecycle stages remain shared.

See Vue SDK, Solid SDK, and Svelte SDK for the package-specific entry points.

References: packages/…/index.ts• L1-5 packages/…/index.tsx• L1-11 packages/…/index.ts• L1-7 packages/…/useUploadThing.ts• L160-188 packages/…/create-uploadthing.ts• L143-171 packages/…/create-uploadthing.ts• L146-171

Nuxt module boundary

The Nuxt package joins client and server setup in one module. It registers the UploadThing API handler, exposes the app's router to that handler, adds upload components and the useUploadThing auto-import, and manages the package styles. This lets a Nuxt app use the Vue-facing upload surface while keeping route handling inside Nuxt's server runtime.

See Nuxt SDK for the module setup and runtime path.

References: packages/…/module.ts• L38-113 packages/…/useUploadThing.ts• L1-5 packages/…/uploadthing.ts• L1-25 packages/…/router.ts• L1-5

Expo device boundary

The Expo package adapts native assets to the web-like file input expected by the shared uploader. The image helper can use the library or camera and respects route media types and multiple-file rules. The document helper uses route MIME types and the same count rule. Both helpers report cancel and permission outcomes before they enter the normal upload lifecycle.

See Expo SDK for native picker behavior and asset handling.

References: packages/…/index.ts• L45-84 packages/…/image-picker.ts• L28-137 packages/…/document-picker.ts• L36-100

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the endpoint input and result types aligned with the shared FileRouter contract when changing any framework helper.
  • Keep route metadata handling aligned with picker and dropzone filters. Client filters must continue to reflect server route rules.
  • Keep the callback order and abort distinction aligned across the web helpers, native helpers, and generated controls.
  • When changing Nuxt module registration, update the relationship between the configured router path, /api/uploadthing, auto-imports, and injected styles.
  • When changing the client request URL or fetch options, check browser, Nuxt, and Expo origin resolution separately.

Important failure modes

TriggerConsequenceGuard
The client points to an API route that does not use the matching file routerRoute metadata or upload negotiation fails, or the server rejects the endpointKeep the client endpoint and server router on the same contract and verify the configured API URL
Route metadata is unavailable when a control or picker startsThe control can show no allowed types or use broad native picker defaultsEnsure the API route is reachable before relying on client-side filters. The server still validates the upload
A Nuxt router path is missing or points to the wrong routerThe registered handler uses an empty or unintended routerSet the module router path to the app's file router and check the generated server route
Expo cannot resolve the server originPicker selection succeeds but the upload request cannot reach the APISet url or EXPO_PUBLIC_SERVER_ORIGIN for the device runtime
An upload is aborted through a control or pickerThe upload does not call normal completion and must be handled as an abortProvide an abort callback when the UI needs to reset or report cancellation

Key files

FileWhy to read it
packages/…/client.tsDefines the common client negotiation, transfer, progress, pause, resume, and completion behavior used by the framework packages
packages/…/types.tsDefines the file-router, endpoint, route handler, and upload option contracts shared across clients and servers
packages/…/useUploadThing.tsShows the Vue helper binding reactive state to the common uploader
packages/…/create-uploadthing.tsShows the Solid helper binding signals to the common uploader
packages/…/create-uploadthing.tsShows the Svelte helper binding stores to the common uploader
packages/…/module.tsShows how Nuxt registers client components, auto-imports, styles, and the server handler
packages/…/uploadthing.tsShows how Nuxt sends requests to the app's UploadThing router
packages/…/index.tsShows how Expo resolves its server connection and exposes native upload helpers
packages/…/image-picker.tsShows how image and camera selection enters the shared upload flow
packages/…/document-picker.tsShows how document selection enters the shared upload flow