Skip to content

PresignGetObject

Source: src/AWS/S3/PresignGetObject.ts

Mint presigned download (GET) URLs for objects in a Bucket.

Presigning is a pure SigV4 computation performed client-side with the Function’s own credentials — no S3 API call is made. Because the URL inherits the signer’s IAM permissions, the binding grants s3:GetObject on the bucket’s objects to the host Function.

Mint a presigned GET URL

const presignGetObject = yield* S3.PresignGetObject(bucket);
const url = yield* presignGetObject({ key: "reports/2026.pdf" });
// hand `url` to a browser — it can download the object without AWS credentials

Custom expiry and response Content-Type

const url = yield* presignGetObject({
key: "reports/2026.pdf",
expiresIn: 3600, // valid for 1 hour
contentType: "application/pdf",
});