Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin only works with very old and obsolete versions of Uppy #20

Open
andrew-connell opened this issue Mar 2, 2024 · 0 comments
Open

Comments

@andrew-connell
Copy link

Uppy's plugin architecture changed years ago. I started to try and update this plugin but realised it's much easier to just use @uppy/xhr-upload

This is all that's required:

import Uppy from '@uppy/core'
import XHR from '@uppy/xhr-upload'
const uppy=new Uppy({ debug: true })
 .use(XHR, {endpoint: IMAGEKIT_URL_ENDPOINT})
  .on('file-added', (file) => {
    fetch(ENDPOINT).then((response) => response.json()).then((data) => {
      uppy.setFileMeta(file.id, {
        fileName: file.name,
        publicKey: IMAGEKIT_PUBLIC_KEY,
        signature: data.signature,
        expire: data.expire,
        token: data.token,
      })
    })
  })

It now works perfectly and is future proof. I'm not sure this plugin is necessary at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant