🎉 Next S3 Uploader is now in beta! Please report any bugs or issues on GitHub.
API Reference
generatePresignedUrls

generatePresignedUrls(s3Client, keys, bucket, prefix?, privateBucket?)

Generates pre-signed URLs for uploading objects to S3.

  • s3Client: An instance of the S3 client generated by either createS3Client or @aws-sdk/client-s3.
  • keys: An array of object keys to upload.
  • bucket: The S3 bucket name.
  • prefix: (Optional) Prefix for object keys.
  • privateBucket: (Optional) Whether the bucket is private. Default is false.
  • operation: (Optional) Whether the URLs are for uploading or downloading. Default is upload. For downloading, set to download.
  • options: (Optional) Options for the pre-signed URLs. Currently only supports expiresIn in seconds. Default is 3600 (1 hour).
const urls = await generatePresignedUrls(
  s3Client,
  keys,
  bucket,
  prefix,
  privateBucket,
  operation,
  options
);