Skip to content

@uploadthing/[email protected]

Compare
Choose a tag to compare
@t3dotgg t3dotgg released this 14 Nov 22:42
· 391 commits to main since this release
d4ea3ba

Major Changes

  • #351
    0ef63c6
    Thanks @juliusmarminge! - feat: support
    returning data from the serverside onUploadComplete callback to the
    clientside onClientUploadComplete. 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
    using generateComponents. 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 the url parameter to
    generateComponents and generateReactHelpers/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