Gathering detailed insights and metrics for @aws-sdk/s3-request-presigner
Gathering detailed insights and metrics for @aws-sdk/s3-request-presigner
Gathering detailed insights and metrics for @aws-sdk/s3-request-presigner
Gathering detailed insights and metrics for @aws-sdk/s3-request-presigner
@trivikr-test/s3-request-presigner
Please refer [README.md](https://github.com/aws/aws-sdk-js-v3/blob/v3.170.0/packages/s3-request-presigner/README.md) for v3.170.0.
@dos-sdk/s3-request-presigner
[](https://www.npmjs.com/package/@aws-sdk/s3-request-presigner) [](https://www.npmjs.com/
@trivikr-test/s3-request-presigner-esm
[](https://www.npmjs.com/package/@aws-sdk/s3-request-presigner) [](https://www.npmjs.com/
@trivikr-test/s3-request-presigner-esm-wrapper
[](https://www.npmjs.com/package/@aws-sdk/s3-request-presigner) [](https://www.npmjs.com/
Modularized AWS SDK for JavaScript.
npm install @aws-sdk/s3-request-presigner
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.7
Supply Chain
100
Quality
96.6
Maintenance
100
Vulnerability
100
License
TypeScript (99.65%)
Java (0.23%)
JavaScript (0.1%)
Gherkin (0.01%)
Total Downloads
283,033,216
Last Day
148,497
Last Week
3,145,689
Last Month
13,537,597
Last Year
132,479,923
Apache-2.0 License
3,349 Stars
9,551 Commits
619 Forks
42 Watchers
12 Branches
167 Contributors
Updated on Jul 04, 2025
Minified
Minified + Gzipped
Latest Version
3.842.0
Package Id
@aws-sdk/s3-request-presigner@3.842.0
Unpacked Size
33.74 kB
Size
9.52 kB
File Count
16
NPM Version
10.9.2
Node Version
18.20.6
Published on
Jul 02, 2025
Cumulative downloads
Total Downloads
Last Day
5.5%
148,497
Compared to previous day
Last Week
-6.8%
3,145,689
Compared to previous week
Last Month
1.1%
13,537,597
Compared to previous month
Last Year
61.5%
132,479,923
Compared to previous year
This package provides a presigner based on signature V4 that will attempt to generate signed url for S3.
You can generated presigned url from S3 client and command. Here's the example:
1import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; 2import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3"; 3const client = new S3Client(clientParams); 4const command = new GetObjectCommand(getObjectParams); 5const url = await getSignedUrl(client, command, { expiresIn: 3600 });
You can get signed URL for other S3 operations too, like PutObjectCommand
.
expiresIn
config from the examples above is optional. If not set, it's default
at 900
.
If you already have a request, you can pre-sign the request following the section bellow.
1import { S3RequestPresigner } from "@aws-sdk/s3-request-presigner"; 2import { Sha256 } from "@aws-crypto/sha256-browser"; 3import { Hash } from "@aws-sdk/hash-node"; 4const signer = new S3RequestPresigner({ 5 region: regionProvider, 6 credentials: credentialsProvider, 7 sha256: Hash.bind(null, "sha256"), // In Node.js 8 //sha256: Sha256 // In browsers 9}); 10const presigned = await signer.presign(request);
To avoid redundant construction parameters when instantiating the s3 presigner, you can simply spread the configuration of an existing s3 client and supply it to the presigner's constructor.
1//s3 is instantiated from S3Client from @aws-sdk/client-s3-* packages 2const signer = new S3RequestPresigner({ 3 ...s3.config, 4});
By using the getSignedUrl
with a S3Client
you are able to sign your
headers, improving the security of presigned url. Importantly, if you want to
sign any x-amz-*
headers (like the ChecksumSHA256 header in this example),
you need to provide those headers to the set of unhoistableHeaders
in the
getSignedUrl
params which will force those headers to be present in the
upload request.
1import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3"; 2import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; 3 4const s3Client = new S3Client({ region: "us-east-1" }); 5const command = new PutObjectCommand({ 6 Bucket: bucket, 7 Key: key, 8 ChecksumSHA256: sha, 9}); 10 11const presigned = getSignedUrl(s3Client, command, { 12 expiresIn: expiration, 13 // Set of all x-amz-* headers you wish to have signed 14 unhoistableHeaders: new Set(["x-amz-checksum-sha256"]), 15});
For headers that are not x-amz-*
you are able to add them to the set of
signableHeaders
to be enforced in the presigned urls request.
1import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3"; 2import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; 3 4const s3Client = new S3Client({ region: "us-east-1" }); 5const command = new PutObjectCommand({ 6 Bucket: bucket, 7 Key: key, 8 ContentType: contentType, 9}); 10 11const presigned = getSignedUrl(s3Client, command, { 12 signableHeaders: new Set(["content-type"]), 13 expiresIn: expiration, 14});
hoistableHeaders
hoistableHeaders
overrides the default behavior of not hoisting
any headers that begin with x-amz-*
.
1// example: Server Side Encryption headers 2import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; 3import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3"; 4 5const params = { 6 Key: "...", 7 Bucket: "...", 8 ServerSideEncryption: "aws:kms", 9 SSEKMSKeyId: "arn:aws:kms:us-west-2:0000:key/abcd-1234-abcd", 10}; 11const s3Client = new S3Client(); 12const command = new PutObjectCommand(params); 13 14const preSignedUrl = await getSignedUrl(s3Client, command, { 15 hoistableHeaders: new Set(["x-amz-server-side-encryption", "x-amz-server-side-encryption-aws-kms-key-id"]), 16});
No vulnerabilities found.
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
binaries present in source code
Details
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
28 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More