# s3bucket-upload-uppy

> s3bucket-upload-uppy can be used to directly upload files to AWS S3 Bucket without a Backend API. This library uses Uppy File Uploader Interface

Latest version **0.0.6** (published 2020-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install s3bucket-upload-uppy
pnpm add s3bucket-upload-uppy
yarn add s3bucket-upload-uppy
bun add s3bucket-upload-uppy
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2020-10-09 |
| First published | 2020-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 245.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Adrita Sharma |
| Maintainers | adritasharma |
| Keywords | s3 bucket uppy, file-upload s3 bucket, uppy angular, angular s3 bucket upload |

## Links

- npm: https://www.npmjs.com/package/s3bucket-upload-uppy
- Repository: https://github.com/adritasharma/s3bucket_Direct_Upload_Uppy
- Homepage: https://github.com/adritasharma/s3bucket_Direct_Upload_Uppy#readme
- Issues: https://github.com/adritasharma/s3bucket_Direct_Upload_Uppy/issues
- npm.io page: https://npm.io/package/s3bucket-upload-uppy

## Dependencies (3)

- [uppy](https://npm.io/package/uppy.md) ~1.21.1
- [tslib](https://npm.io/package/tslib.md) ^1.9.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.764.0

## Recent versions

- 0.0.6 (latest) — 2020-10-09
- 0.0.5 — 2020-10-08
- 0.0.4 — 2020-10-02
- 0.0.3 — 2020-10-01
- 0.0.2 — 2020-10-01
- 0.0.1 — 2020-10-01

## README

# s3bucket-upload-uppy

s3bucket-upload-uppy can be used to directly upload files to AWS S3 Bucket without a Backend API.
This library uses <a  href="https://uppy.io/docs/"  target="_blank">Uppy</a>  File Uploader Interface

Uppy's <a href="https://uppy.io/docs/"  target="_blank"> Official Documentation </a>


## Installation

>npm i s3bucket-upload-uppy

## Import & Initialization

### app.module.ts

    import { S3BucketUppyUploadModule } from 's3bucket-upload-uppy';

    @NgModule({
        imports: [
            S3BucketUppyUploadModule,
            ...
        ],
        ...
    })


### Component Template

    <ng-s3Bucket-uppy [config]="settings" (onFileAdd)="onFileAdd($event)" (onFileUpload)="onFileUpload($event)"
    (uploadResult)="uploadResult($event)"></ng-s3Bucket-uppy>

### Component TS

    import { UppyConfig } from 's3bucket-upload-uppy';

    settings: UppyConfig = {
        plugins: {
            Webcam: true,
            GoogleDrive: true,
            Instagram: true,
            Facebook: true,
            Dropbox: true,
            ScreenCapture: true
        },
        restrictions: {
            maxNumberOfFiles: 10,
        },
        options: {
            debug: true,
        },
        uploaderLook: {
            note: "",
            theme: 'auto',
            proudlyDisplayPoweredByUppy: true
        },
            statusBarOptions: {
            showProgressDetails: true,
            hideRetryButton: false,
            hideCancelButton: false,
            hideProgressAfterFinish: false
        },
        awsConfig:{
            folderName:"Test",
            s3BucketCredentials: environment.s3BucketCredentials
        }
    }


S3 Bucket Credentials can be kept in environment.ts


    export const environment = {
        ...
        s3BucketCredentials: {
            accessKeyId: 'YOUR_ACCESS_ID',
            secretAccessKey: 'YOUR_SECRET_ACCESS_KEY',
            region: 'YOUR_REGION_NAME',
            Bucket:'YOUR_BUCKET_NAME'
        }
    };

### Adding style

Add the cdn stylesheet in index.html 

### index.html

        <link href="https://transloadit.edgly.net/releases/uppy/v1.21.1/uppy.min.css" rel="stylesheet">




## Settings

### Input

<table>
<tr>
<td>Name</td>
<td>Type</td>
<td>Description</td>
</tr>
<tr>
<td>config</td>
<td>UppyConfig (Custom Type)</td>
<td>Uploader Configuration</td>
</tr>
</table>



### Output

<table>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
<tr>
<td>(onFileAdd)</td>
<td>Emits file data on each file add</td>
</tr>
<tr>
<td>(onFileUpload)</td>
<td>Emits uploaded data when Upload is succesfully completed in backend</td>
</tr>
<tr>
<td>(onFileAdd)</td>
<td>Emits upload result irrespective of backend success/failure</td>
</tr>
</table>




### UppyConfig Description


    export interface UppyConfig {
        plugins?: {
            GoogleDrive?: boolean // null | boolean - Allow Uploading Photo From GoogleDrive
            Instagram?: boolean // null | boolean - Allow Uploading Photo From Instagram
            Webcam?: boolean // null | boolean - Allow Taking Photo From Webcam
            Dropbox?: boolean // null | boolean - Allow Uploading Photo From Dropbox
            Facebook?: boolean // null | boolean - Allow Uploading Photo From Facebook
            ScreenCapture?: boolean // null | boolean - Allow Taking ScreenCast
        },
        restrictions?: {
            maxFileSize?: number, //null | number — maximum file size in bytes for each
            maxNumberOfFiles?: number,//null | number — total number of files that can be selected
            minNumberOfFiles?: number,//null | number — minimum number of files that must
            allowedFileTypes?: Array<string> // null | array of wildcards image/*, exact mime types image/jpeg, or file extensions .jpg: ['image/*', '.jpg', '.jpeg', '.png', '.gif']
        },
        statusBarOptions: {
            hideAfterFinish?: boolean //Hide the Status Bar after the upload is complete
            showProgressDetails?: boolean, // By default, progress in Status Bar is shown as a simple percentage. If you would like to also display remaining upload size and time, set this to true.
            hideUploadButton?: boolean, // Hide the upload button. Use this if you are providing a custom upload button somewhere, and using the uppy.upload() API
            hideRetryButton?: boolean, // Hide the retry button in StatusBar
            hidePauseResumeButton?: boolean, // Hide the pause/resume button in StatusBar and on each individual file.
            hideCancelButton?: boolean, // Hide the cancel button in StatusBar and on each individual file.
            hideProgressAfterFinish?: boolean,// Hide Status Bar after the upload has finished
        },
        uploaderLook: {
            theme?: string, // light | dark | auto
            note?: string, // Optionally, specify a string of text that explains something about the upload for the user. This is a place to explain any restrictions that are put in place. 
            proudlyDisplayPoweredByUppy?: boolean, //Uppy is provided to the world for free by the team behind Transloadit. In return, we ask that you consider keeping a tiny Uppy logo at the bottom of the Dashboard, so that more people can discover and use Uppy. This is, of course, entirely optional. Just set this option to false if you do not wish to display the Uppy logo
            width?: number, //null | number — Width of the Dashboard in pixels.
            height?: number, //null | number — Height of the Dashboard in pixels.
            thumbnailWidth?: number, //null | number — Width of the Thumbnail in pixels.
        },
        options? : {
            id?: string, //A site-wide unique ID for the instance.
            debug?: boolean,
            browserBackButtonClose?: boolean
            autoProceed?: boolean, //Setting this to true will start uploading automatically after the first file is selected without waiting for upload button trigger.
            allowMultipleUploads?: boolean, //Setting this to true,  users can upload some files, and then add more files and upload those as well
            meta?: {} //Metadata object, used for passing things like public keys, usernames, tags and so on
        },
        awsConfig? :{
            folderName?:string // Name of the folder in your Bucket
            s3BucketCredentials: {
                accessKeyId: string,
                secretAccessKey: string,
                region:string,
                Bucket:string
            }
        }
    
    }

---
_Source: https://npm.io/package/s3bucket-upload-uppy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
