strapi-provider-upload-aws-s3-v3
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

AWS S3 Plugin

Overview

This module provides a simple interface for uploading documents and images to Amazon S3 using the AWS SDK. It is designed to work seamlessly with the folder structure of the Media Library plugin, ensuring efficient and organized file management.

Features

  • Folder Organization:

    • Uploaded files are stored in their respective folders based on type.
    • Follows the folder structure of the Media Library plugin.
  • Thumbnail Management:

    • If an uploaded image includes thumbnails, they are automatically placed in a dedicated thumbnails folder for easy access and management.

This module simplifies the process of managing media uploads and integrates seamlessly with the Media Library plugin.

Table of Contents

Resources

This module utilizes the AWS SDK to interact with the following AWS services:

  • Amazon S3: For storing, retrieving, and deleting objects.
  • S3 Request Presigner: For generating pre-signed URLs to securely upload and access objects.

Links

Installation

Using npm

npm install strapi-provider-upload-aws-s3-v3

Using yarn

yarn add strapi-provider-upload-aws-s3-v3

Configuration

Variable Type Description Required Default
providerOptions object Configuration options for the S3 client. See AWS SDK documentation. yes N/A
providerOptions.params object Extra configuration such, bucket,acl etc... yes N/A
providerOptions.params.bucket string The name of the bucket yes undefined
providerOptions.params.acl string Provide type of acl for objects, it can ve private or public-read yes undefined
providerOptions.params.signedUrlExpires string Time of expiration for signed urls yes undefined
providerOptions.params.cdn_url string If you are using a cdn for the url, provide the cdn url. no undefined

Example

Path - config/plugins.js

module.exports = ({ env }) => ({
  //...
  upload: {
      config: {
        provider: "strapi-provider-upload-aws-s3-v3",
        providerOptions: {
          credentials: AwsCredentialsObject,
          region: env("AWS_REGION"),
          params: {
            acl: env("AWS_ACL", "private"),
            signedUrlExpires: env("AWS_SIGNED_URL_EXPIRES", 15 * 60),
            bucket: env("AWS_BUCKET"),
          },
        },
      },
    },
  //...
});

Authors

Feel free to reach out with questions, suggestions, or contributions!

Readme

Keywords

Package Sidebar

Install

npm i strapi-provider-upload-aws-s3-v3

Weekly Downloads

4

Version

1.1.1

License

MIT

Unpacked Size

16.1 kB

Total Files

10

Last publish

Collaborators

  • jsalazar-dev