Gathering detailed insights and metrics for react-native-aws3
Gathering detailed insights and metrics for react-native-aws3
Gathering detailed insights and metrics for react-native-aws3
Gathering detailed insights and metrics for react-native-aws3
Pure JavaScript React Native library for uploading to AWS S3
npm install react-native-aws3
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
399 Stars
65 Commits
150 Forks
11 Watchers
2 Branches
5 Contributors
Updated on Apr 14, 2025
Latest Version
0.0.9
Package Id
react-native-aws3@0.0.9
Unpacked Size
29.43 kB
Size
7.98 kB
File Count
12
NPM Version
6.5.0-next.0
Node Version
11.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
React Native AWS3 is a module for uploading files to S3. Unlike other libraries out there, there are no native dependencies.
npm install --save react-native-aws3
The user associated with the accessKey
and secretKey
you use must have the appropriate permissions assigned to them. My user's IAM policy looks like:
1{ 2 "Version": "2012-10-17", 3 "Statement": [ 4 { 5 "Sid": "Stmt1458840156000", 6 "Effect": "Allow", 7 "Action": [ 8 "s3:GetObject", 9 "s3:GetObjectAcl", 10 "s3:GetObjectVersion", 11 "s3:PutObject", 12 "s3:PutObjectAcl", 13 "s3:PutObjectVersionAcl" 14 ], 15 "Resource": [ 16 "arn:aws:s3:::my-bucket/uploads/*" 17 ] 18 } 19 ] 20}
1import { RNS3 } from 'react-native-aws3'; 2 3const file = { 4 // `uri` can also be a file system path (i.e. file://) 5 uri: "assets-library://asset/asset.PNG?id=655DBE66-8008-459C-9358-914E1FB532DD&ext=PNG", 6 name: "image.png", 7 type: "image/png" 8} 9 10const options = { 11 keyPrefix: "uploads/", 12 bucket: "your-bucket", 13 region: "us-east-1", 14 accessKey: "your-access-key", 15 secretKey: "your-secret-key", 16 successActionStatus: 201 17} 18 19RNS3.put(file, options).then(response => { 20 if (response.status !== 201) 21 throw new Error("Failed to upload image to S3"); 22 console.log(response.body); 23 /** 24 * { 25 * postResponse: { 26 * bucket: "your-bucket", 27 * etag : "9f620878e06d28774406017480a59fd4", 28 * key: "uploads/image.png", 29 * location: "https://your-bucket.s3.amazonaws.com/uploads%2Fimage.png" 30 * } 31 * } 32 */ 33});
Upload a file to S3.
Arguments:
file
uri
required - File system URI, can be assets library path or file://
pathname
required - The name of the file, will be stored as such in S3type
required - The mime type, also used for Content-Type
parameter in the S3 post policyoptions
acl
- The Access Control List of this object. Defaults to public-read
keyPrefix
- Prefix, or path to the file on S3, i.e. uploads/
(note the trailing slash)bucket
required - Your S3 bucketregion
required - The region of your S3 bucketaccessKey
required - Your S3 AWSAccessKeyId
secretKey
required - Your S3 AWSSecretKey
successActionStatus
- HTTP response status if successful, defaults to 201awsUrl
- AWS S3 url. Defaults to s3.amazonaws.com
timeDelta
- Devices time offset from world clock in milliseconds, defaults to 0Returns an object that wraps an XMLHttpRequest
instance and behaves like a promise, with the following additional methods:
progress
- accepts a callback which will be called with an event representing the progress of the upload. Event object is of shape
loaded
- amount uploadedtotal
- total amount to uploadpercent
- number between 0 and 1 representing the percent completedabort
- aborts the xhr instanceExamples:
1RNS3.put(file, options) 2 .progress((e) => console.log(e.loaded / e.total)); // or console.log(e.percent) 3 4RNS3.put(file, option) 5 .abort();
DeleteObject
and (authenticated) GetObject
operations.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/9 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
69 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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