
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@veho-tech/react-native-aws3
Advanced tools
Pure JavaScript react native library for uploading to AWS S3
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:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1458840156000",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetObjectVersion",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectVersionAcl"
],
"Resource": [
"arn:aws:s3:::my-bucket/uploads/*"
]
}
]
}
import { RNS3 } from 'react-native-aws3';
let file = {
// `uri` can also be a file system path (i.e. file://)
uri: "assets-library://asset/asset.PNG?id=655DBE66-8008-459C-9358-914E1FB532DD&ext=PNG",
name: "image.png",
type: "image/png"
}
let options = {
keyPrefix: "uploads/",
bucket: "your-bucket",
region: "us-east-1",
accessKey: "your-access-key",
secretKey: "your-secret-key",
successActionStatus: 201
}
RNS3.put(file, options).then(response => {
if (response.status !== 201)
throw new Error("Failed to upload image to S3");
console.log(response.body);
/**
* {
* postResponse: {
* bucket: "your-bucket",
* etag : "9f620878e06d28774406017480a59fd4",
* key: "uploads/image.png",
* location: "https://your-bucket.s3.amazonaws.com/uploads%2Fimage.png"
* }
* }
*/
});
Upload a file to S3.
Arguments:
fileuri 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 policyoptionsacl - The Access Control List of this object. Defaults to public-readkeyPrefix - 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 AWSAccessKeyIdsecretKey required - Your S3 AWSSecretKeysuccessActionStatus - HTTP response status if successful, defaults to 201awsUrl - AWS S3 url. Defaults to s3.amazonaws.comtimeDelta - 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:
RNS3.put(file, options)
.progress((e) => console.log(e.loaded / e.total)); // or console.log(e.percent)
RNS3.put(file, option)
.abort();
DeleteObject and (authenticated) GetObject operations.FAQs
Pure JavaScript react native library for uploading to AWS S3
We found that @veho-tech/react-native-aws3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.