Giter Site home page Giter Site logo

timmikeladze / next-upload Goto Github PK

View Code? Open in Web Editor NEW
88.0 2.0 4.0 1.64 MB

๐Ÿ—ƒ๏ธ Turn-key solution for signed & secure file-uploads to an S3 compliant storage service such as R2, AWS, or Minio. Built for Next.js. Generates signed URLs for uploading files directly to your storage service and optionally integrates with a database to store additional metadata about your files.

License: MIT License

JavaScript 4.56% Shell 0.74% TypeScript 94.70%
blob-storage next nextjs r2 s3 signed-url upload uploads next-upload hacktoberfest

next-upload's People

Contributors

dependabot[bot] avatar renovate[bot] avatar timmikeladze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

next-upload's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @storybook/testing-library Unavailable
npm @types/dotenv Unavailable
npm trim Unavailable

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update vitest monorepo to v2 (major) (@vitest/coverage-v8, vitest)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yml
github-actions
.github/workflows/main.yml
  • harmon758/postgresql-action v1
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • @aws-sdk/client-s3 ^3.554.0
  • @aws-sdk/s3-presigned-post ^3.554.0
  • @aws-sdk/s3-request-presigner ^3.554.0
  • bytes ^3.1.2
  • nanoid ^5.0.7
  • next-tool ^0.0.6
  • @babel/core 7.24.4
  • @babel/preset-env 7.24.4
  • @babel/preset-react 7.24.1
  • @babel/preset-typescript 7.24.1
  • @commitlint/cli 19.2.1
  • @commitlint/config-conventional 19.1.0
  • @keyv/postgres 1.4.10
  • @ryansonshine/commitizen 4.2.8
  • @ryansonshine/cz-conventional-changelog 3.3.4
  • @storybook/addon-essentials 8.0.8
  • @storybook/addon-interactions 8.0.8
  • @storybook/addon-links 8.0.8
  • @storybook/blocks 8.0.8
  • @storybook/react 8.0.8
  • @storybook/react-webpack5 8.0.8
  • @storybook/storybook-deployer 2.8.16
  • @storybook/testing-library 0.2.2
  • @testing-library/jest-dom 6.4.2
  • @testing-library/react 15.0.2
  • @types/bytes 3.1.4
  • @types/dotenv 8.2.0
  • @types/node 20.12.7
  • @types/react 18.2.78
  • @types/react-dom 18.2.25
  • @types/react-test-renderer 18.0.7
  • @typescript-eslint/eslint-plugin 6.18.1
  • @typescript-eslint/parser 6.18.1
  • @vitejs/plugin-react 4.2.1
  • @vitest/coverage-v8 1.5.0
  • babel-loader 9.1.3
  • concurrently 8.2.2
  • dotenv 16.4.5
  • drizzle-kit 0.20.14
  • drizzle-orm 0.30.8
  • eslint 8.56.0
  • eslint-config-airbnb 19.0.4
  • eslint-config-prettier 9.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-jsx-a11y 6.8.0
  • eslint-plugin-prefer-arrow 1.2.3
  • eslint-plugin-prettier 5.1.3
  • eslint-plugin-react 7.33.2
  • eslint-plugin-react-hooks 4.6.0
  • eslint-plugin-sort-class-members 1.19.0
  • eslint-plugin-storybook 0.6.15
  • eslint-plugin-typescript-sort-keys 3.1.0
  • eslint-plugin-unused-imports 3.0.0
  • husky 9.0.11
  • jsdom 24.0.0
  • keyv 4.5.4
  • lint-staged 15.2.2
  • mysql2 3.9.4
  • next 14.2.1
  • postgres 3.4.4
  • prettier 3.2.5
  • prop-types 15.8.1
  • react 18.2.0
  • react-dom 18.2.0
  • react-test-renderer 18.2.0
  • release-it 17.2.0
  • storybook 8.0.8
  • tsdoc-markdown 0.5.0
  • tsup 8.0.2
  • typescript 5.4.5
  • vitest 1.5.0
  • yalc 1.0.0-pre.53
  • drizzle-orm >=0.27
  • keyv >=4
  • next >=13
  • react >=17
  • react-dom >=17
  • node >=14.0.0
  • glob-parent >=5.1.2
  • parse-url >=8.1.0
  • trim >=0.0.3
  • trim-newlines >=3.0.1
  • yaml >=2.2.2
  • semver >=7.5.2
  • ip >=1.1.9

  • Check this box to trigger a request for Renovate to run again on this repository

Figure out how to store metadata purely in s3

When creating a post policy there is a function available to add metadata to the post policy then gets set on the stored object once the file is uploaded.

I have this flow currently working, however I am not able to figure out how to construct the PUT request that is sent to the post policy url.

I've tried sending metadata as headers or in the form request body, prefixing and not prefixing with the x-amz- headers.

All the approaches ended up in a rejected request.

If this is figured out then next-upload will be able to store metadata for uploaded files without requiring an asset store to be configured.

400 Bad Request when using with R2

Hey Tim,

I'm getting an error when trying to use the lib with R2 for some reason. I have tested my config & endpoint using Bruno ( Postman alternative) and that works properly, but I'm getting bad request with next-upload.
Have you ever tested it with R2?

Error:

image

This is my config:

export const config: NextUploadConfig = {
    maxSize: '3mb',
    bucket: '<bucket_name>',
    client: {
        region: 'auto',
        endpoint: env.R2_BUCKET_ENDPOINT,
        credentials: {
            secretAccessKey: env.R2_SECRET_KEY,
            accessKeyId: env.R2_ACCESS_KEY,
        },
    },
};

Thank you,
-8x4

Why eat the possible errors in the upload ?

Hello,

In the file src/react/useNextUpload.tsx, in the upload function returned by the hook useNextUpload, why does it eat the possible errors ? Is it for security reasons, to not let confidential information leaking to the client ? Then, why not throw a generic error instead ?

In my use case, I'm finding myself with some failed upload requests (due to external reasons) and since the errors are eaten, the app continues the flow and I end up with corrupted orders in my database, which can result in a bad deliver for my clients.

If it's indeed a bug, I can propose a PR. If it's not, let me know your reasons, please.

Thanks

Prisma store

Hello,

I'm using this package with Prisma ORM. I saw there is no store for it. I can try a PR for it if it's welcome.

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.