mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-20 16:53:33 +00:00
fixes #6181 `uploadRemoteFile()` now treats one remote upload attempt as a single queue-owned unit. Instead of queueing “request token” and “open websocket / wait for upload” as two separate jobs, it now: - acquires one queue slot - reuses serverToken if resuming, otherwise requests a new token - immediately proceeds to the websocket/upload phase within that same admitted attempt That removes the stale-token race where Companion starts its 60s socket-wait timer before the client’s websocket phase has actually been admitted by the queue. Retries still reacquire the queue per attempt, and existing abort/cancel behavior is preserved. refer https://github.com/transloadit/uppy/issues/6181#issuecomment-4295036192 for more context about the bug |
||
|---|---|---|
| .. | ||
| src | ||
| .npmignore | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| turbo.json | ||
@uppy/companion-client
Client library for communication with Companion. Intended for use in Uppy plugins.
Uppy is being developed by the folks at Transloadit, a versatile file encoding service.
Example
import Uppy from '@uppy/core'
import { Provider, RequestClient, Socket } from '@uppy/companion-client'
const uppy = new Uppy()
const client = new RequestClient(uppy, {
companionUrl: 'https://uppy.mywebsite.com/',
})
client.get('/drive/list').then(() => {})
const provider = new Provider(uppy, {
companionUrl: 'https://uppy.mywebsite.com/',
provider: providerPluginInstance,
})
provider.checkAuth().then(() => {})
const socket = new Socket({ target: 'wss://uppy.mywebsite.com/' })
socket.on('progress', () => {})
Installation
Unless you are writing a custom provider plugin, you do not need to install this.
$ npm install @uppy/companion-client
Documentation
Documentation for this plugin can be found on the Uppy website.