@flink-app/s3-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.12.1-alpha.15 • Public • Published

Flink API Docs

WORK IN PROGRESS 👷‍♀️👷🏻‍♂️

A FLINK plugin that lets you work with s3.

Usage

Install plugin to your flink app project:

npm i -S @flink-app/s3-plugin

Add and configure plugin in your app startup (probable the index.ts in root project):

import { s3Plugin } from "@flink-app/s3-plugin";


function start() {
  new FlinkApp<AppContext>({
    name: "My app",
    plugins: [
        // Register plugin
        s3Plugin({
                accessKeyId: "XXX",
                secretAccessKey: "YYY",
                bucket: "ZZZ",
                s3Acl: "public-read",
                enableUpload: true,
        }),
    ],
  }).start();
}

Finally add the s3PluginContext to your Ctx.ts

import { s3PluginContext } from "@flink-app/s3-plugin"
export interface Ctx extends FlinkContext<s3PluginContext> {

}

Using built in upload endpoint

Set enableUpload = true to enable the /file-upload endpoint. Post a multipart file upload to that endpoint to upload the file to S3. Protect this route by specifying the required permission by specifying uploadPermissionRequired property to the required permission. Eg. uploadPermissionRequired="authenticated" setting.

Using the s3Client

From your handlers, access the s3Client by ctx.plugins.s3Plugin.s3Client. You will find methods for upload, delete and so on.

Readme

Keywords

none

Package Sidebar

Install

npm i @flink-app/s3-plugin

Weekly Downloads

70

Version

0.12.1-alpha.15

License

MIT

Unpacked Size

34.2 kB

Total Files

23

Last publish

Collaborators

  • joelso
  • jenkins-frost
  • johanfrost