JS Upload Client

Upload Client handles uploading operations by wrapping Uploadcare Upload API. You can use it from withing your Node.js app and in a browser.



Upload features:

  • Upload files from local storage and URLs (up to 5 TB)
  • Multipart uploading for large files
  • Track uploading progress
  • Bulk file uploading
  • Uploading network to speed uploading jobs (like CDN)

Security features:

  • Secure authentication
  • Secure uploads (signed uploads)


npm install @uploadcare/upload-clientbash


To access the High-Level API, you need to create an instance of UploadClient providing the necessary settings. Specifying YOUR_PUBLIC_KEY is mandatory: it points to the specific Uploadcare project:

import UploadClient from '@uploadcare/upload-client'

const client = new UploadClient({ publicKey: 'YOUR_PUBLIC_KEY' })javascript

Usage example

Once the UploadClient instance is created, you can start using the wrapper to upload files from binary data:

  .then(file => console.log(file.uuid))javascript

Another option is uploading files from URL, via the uploadFile method:

const fileURL = 'https://example.com/file.jpg'

  .then(file => console.log(file.uuid))javascript

You can also use the uploadFile method to get previously uploaded files via their UUIDs:

const fileUUID = 'edfdf045-34c0-4087-bbdd-e3834921f890'

  .then(file => console.log(file.uuid))javascript

You can track uploading progress:

const fileUUID = 'edfdf045-34c0-4087-bbdd-e3834921f890'
const onProgress = ({ value }) => {

  .uploadFile(fileUUID, { onProgress })
  .then(file => console.log(file.uuid))javascript

You can cancel file uploading and track this event:

const fileUUID = 'edfdf045-34c0-4087-bbdd-e3834921f890'
const abortController = new AbortController()

  .uploadFile(fileUUID, { signal: abortController })
  .then(file => console.log(file.uuid))
  .catch(error => {
    if (error.isCancel) {
      console.log(`File uploading was canceled.`)

// Cancel uploading


npm run test

By default, tests will run with a mock server. You can run tests within production environment too.

Run test on production servers:

npm run test:productionbash

Run test with a mock server (mock server starts automaticaly):

npm run testbash

Run a mock server:

npm run mock:start

And then you can run your test:

npm run test:jest

Full documentation

Read the full documentation on GitHub.