Giter VIP home page Giter VIP logo

reaction-file-collections-sa-s3's Introduction

reaction-file-collections-sa-s3

npm (scoped)

An AWS S3 adapter for reaction-file-collections, brought to you by out:grow.

Installation

Open a terminal in your project's reaction (API) directory, and install the package from NPM using the following command:

npm install @outgrowio/reaction-file-collections-sa-s3

Configuration

Set up your AWS S3 credentials using environment variables:

# The AWS region your S3 bucket is in (if using S3 on AWS)
AWS_S3_REGION=us-east-1

# The custom S3 endpoint you'd like to use (if using an S3-compatible API like Min.io)
AWS_S3_ENDPOINT=http://some.endpoint.com:9000

# Name of the S3 bucket you want to store your media in
AWS_S3_BUCKET=reaction-media

# An AWS access key with the appropriate S3 permissions
AWS_ACCESS_KEY_ID=QWERTYUIOPASDFGH

# The secret access key that goes with the access key
AWS_SECRET_ACCESS_KEY=<secret_key>

Usage

In your project's reaction (API) directory, open /src/core-services/files/setUpFileCollections.js.

Replace usages of GridFSStore with S3Store, starting from the import on line 19: const S3Store = require("@outgrowio/reaction-file-collections-sa-s3").default;.

When replacing the GridFSStore constructor with the S3Store one, make sure to pass the following options:

new S3Store({
    name, // Should be provided within buildGFS
    isPublic: true,
    objectACL: "public-read",
    async transformWrite(fileRecord) {
        // Either write your custom transformation code here, or re-use the one from the GridFSStore constructor
    }
});

Help

Need help integrating this plugin into your Reaction Commerce project? Simply looking for expert Reaction Commerce developers? Want someone to train your team to use Reaction at its fullest?

Whether it is just a one-hour consultation to get you set up or helping your team ship a whole project from start to finish, you can't go wrong by reaching out to us:

Contributing

Pull Requests, Issues and Feature Requests are welcome!

reaction-file-collections-sa-s3's People

Contributors

loan-laux avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.