score:0

import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3";
const client = new S3Client({ 
  region: config.region,
  credentials: { 
    accessKeyId: config.accessKeyId,  
    secretAccessKey: config.secretAccessKey,
  },
});
const command = new GetObjectCommand({
    Bucket: 'bucket-name',
    Key:'/path/img.jpg',
    ACL:'public-read',
  });
const url = await getSignedUrl(client, command, { expiresIn: 3600 });

Related Query

More Query from same tag