π Introducing react-native-aws3-manager: The Ultimate Solution for AWS S3 Management in React Native π

Are you tired of dealing with outdated and unsupported libraries for managing AWS S3 in your React Native projects? Look no further!
π We are excited to introduce react-native-aws3-manager
, a robust and actively maintained library designed to simplify your AWS S3 operations. Inspired by the popular but now unmaintained react-native-aws3
, this new package brings enhanced features, improved security, and comprehensive documentation to the table. π
Why Choose react-native-aws3-manager? π€
react-native-aws3-manager
offers several significant advantages over the react-native-aws3
package:
- Maintained and Updated: Unlike
react-native-aws3
, which is no longer maintained,react-native-aws3-manager
is actively maintained and regularly updated to ensure compatibility with the latest versions of React Native and AWS SDKs. π - Enhanced Features: This package includes additional functionalities such as the ability to delete objects and retrieve authenticated objects from AWS S3, making it a one-stop solution for all your S3 needs. πͺ
- TypeScript Support: Fully written in TypeScript,
react-native-aws3-manager
it offers better type safety and an improved developer experience, ensuring your code is less prone to errors. π¨βπ»π©βπ» - Improved Security: The library utilizes
crypto-js
added security features, giving you peace of mind when handling sensitive data. π - Better Documentation: Comprehensive and detailed documentation, including examples for all supported operations, helps you start quickly and efficiently. π
Getting Started with react-native-aws3-manager π
Installation
To install the library and its dependencies, you can use either npm or yarn:
Using npm:
npm install react-native-aws3-manager crypto-js aws-sdk
Using yarn:
yarn add react-native-aws3-manager crypto-js aws-sdk
Usage
The react-native-aws3-manager
library provides an easy-to-use interface for uploading, deleting, and retrieving files from AWS S3 in React Native applications. Here are some examples to get you started:
Uploading a File:
import { RNS3 } from "react-native-aws3-manager";
const file = {
uri: "path-to-your-file",
name: "file-name.jpg",
type: "image/jpeg",
};
const options = {
bucket: "your-bucket",
region: "your-region",
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("Successfully uploaded file to S3:", response.body);
})
.catch((error) => {
console.error("Error uploading file to S3:", error);
});
Deleting a File:
import { RNS3 } from "react-native-aws3-manager";
const options = {
bucket: "your-bucket",
region: "your-region",
accessKey: "your-access-key",
secretKey: "your-secret-key",
};
RNS3.delete("uploads/file-name.jpg", options)
.then((response) => {
if (response.status !== 204) {
throw new Error("Failed to delete file from S3");
}
console.log("Successfully deleted file from S3");
})
.catch((error) => {
console.error("Error deleting file from S3:", error);
});
Retrieving a File:
import { RNS3 } from "react-native-aws3-manager";
const options = {
bucket: "your-bucket",
region: "your-region",
accessKey: "your-access-key",
secretKey: "your-secret-key",
};
RNS3.get("uploads/file-name.jpg", options)
.then((response) => {
if (response.status !== 200) {
throw new Error("Failed to retrieve file from S3");
}
console.log("Successfully retrieved file from S3:", response.body);
})
.catch((error) => {
console.error("Error retrieving file from S3:", error);
});
API Overview π
RNS3.put(file, options)
: Uploads a file to AWS S3.file
: Object containinguri
,name
, andtype
of the file.options
: Object containingbucket
,region
,accessKey
,secretKey
,keyPrefix
, andsuccessActionStatus
.RNS3.delete(key, options)
: Deletes a file from AWS S3.key
: String representing the key of the file to delete.options
: Object containingbucket
,region
,accessKey
, andsecretKey
.RNS3.get(key, options)
: Retrieves a file from AWS S3.key
: String representing the key of the file to retrieve.options
: Object containingbucket
,region
,accessKey
, andsecretKey
.
License and Contributions π
This project is licensed under the MIT License. Contributions are welcome! Please open an issue or submit a pull request for any bugs, improvements, or new features.
By choosing react-native-aws3-manager
, you ensure your project benefits from the latest updates, enhanced security, and comprehensive functionality, making AWS S3 management in React Native a breeze.
π¬οΈ Try it out today and experience the difference! π