Major Changes
-
#351
0ef63c6
Thanks @juliusmarminge! - feat: support
returning data from the serversideonUploadComplete
callback to the
clientsideonClientUploadComplete
. This change also ensures the serverside
callback will finish before the clientside one is invoked.This change has required reworking some types, most notably for people who
were importing the UploadThing components directly from@uploadthing/react
and@uploadthing/solid
instead of generating their own typesafe components
usinggenerateComponents
. We have always recommended using
generateComponents
, but now we're emphasising it even more. -
#310
7c2ed64
Thanks @juliusmarminge! - feat: support
arbitrary callback URLs (serving router from any endpoint). To use a different
endpoint than/api/uploadthing
, you can pass theurl
parameter to
generateComponents
andgenerateReactHelpers
/generateSolidHelpers
(or
pass it as a prop to the components if you're not generating them):export const { UploadButton, UploadDropzone } = generateComponents({ url: "/api/my-upload-endpoint", // if the host is unchanged from default (localhost or VERCEL_URL) // url: "https://my-custom-host.com" // if the host is different but path is /api/uploadthing // url: "https://my-custom-host.com/my-custom-endpoint" // fully custom url });
Minor Changes
- #453
0aae926
Thanks @joelhooks! - Adds an
onBeforeUploadBegin callback that is called before startUpload to allow for
pre-processing of files (ie changing file names etc)
Patch Changes
-
#451
1241a16
Thanks @juliusmarminge! - chore: log out
error if it's an unknown (not UploadThingError)This log should not ever happen, but if it does we want it to be easy to
provide the error when reporting the bug to us."Normal" errors are never logged and you have full control over how to handle
them in youronUploadError
handler. -
Updated dependencies
[0ef63c6
,
0aae926
,
328f59b
,
7c2ed64
,
f32f5c0
,
f32f5c0
,
1241a16
]:- [email protected]
- @uploadthing/[email protected]