Uppy clarification for AWS Multipart upload

I’m a little confused about the best way to use Uppy with AWS Multipart uploading. To my understanding, Uppy has a frontend component that allows users to dynamically choose what content they want to upload.

However, Companion seems to be a server-side feature, as it requires inputting key/secret information, but the multipart API seems to be frontend (AWS S3 Multipart — Uppy). So if I understand right:

  1. We use the main Uppy AWS multipart library to make calls from the frontend via the companionUrl
  2. We have a companion service on a server/serverless framework running in the backend. The frontend calls get handled by this companion service, which makes calls to S3 on our behalf
  3. The companion service sends back the S3 urls to the frontend, which then uses this to upload content.

So then is the companion service necessary? Where else would we specify some endpoint to send frontend requests to?

Hi, you’re close in understanding but this is the exact flow:

  1. @uppy/aws-s3-multipart chops files in ‘parts’
  2. @uppy/aws-s3-multipart exposes every batch of parts via prepareUploadParts so you can sign URLs should you wish to.
  3. @uppy/aws-s3-multipart sends the parts and pre-signed urls to Companion, where it is immediately streamed to S3 (to the URLs specified).

This way your secrets are not exposed. But moreover, Companion really shines when you use any remote provider (such as Google Drive). You save a ton of integration code and the OAuth dance and Companion does everything for you to get the remote file(s) to your destination.