github pingdotgg/uploadthing @uploadthing/react@6.4.0

Minor Changes

  • #705 a919d5a Thanks @juliusmarminge! - feat: add client headers option

    this primarily allows you to authenticate the client when your server is deployed separate from your client:

    import { useUploadThing, UploadButton } from "~/utils/uploadthing";
    
    // Using hook
    const { startUpload } = useUploadThing("endpoint", {
      headers: async () => {
        const token = await getToken();
        return { Authorization: `Bearer ${token}` };
      },
    });
    
    // Using components
    <UploadButton
      endpoint="endpoint"
      headers={async () => {
        const token = await getToken();
        return {
          Authorization: `Bearer ${token}`,
        };
      }}
    />;

Patch Changes

Don't miss a new uploadthing release

NewReleases is sending notifications on new releases.