JS API clients

JS API clients handle uploads and file operations by wrapping Uploadcare Upload API and REST API. You can use it from withing your Node.js app and in a browser.

JS API clients GitHub →

Features

Uploading (Upload API):

  • 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)
  • Secure uploads (signed uploads)

File management (REST API):

  • Get file info and perform various operations (store/delete/copy) with them
  • Manage metadata
  • Manage webhooks
  • Convert documents
  • Encode and transform videos
  • Secure authentication

Image processing (URL API):

  • Compression
  • Geometry
  • Colors
  • Definition
  • Image and text overlays
  • Rotations
  • Recognition
  • File info
  • Proxy (fetch)

Install

$npm install @uploadcare/upload-client
>npm install @uploadcare/rest-client
>npm install @uploadcare/signed-uploads

Usage examples

To access the Upload Client 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:

1import { UploadClient } from '@uploadcare/upload-client'
2
3const client = new UploadClient({ publicKey: 'YOUR_PUBLIC_KEY' })

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

1client
2 .uploadFile(fileData)
3 .then(file => console.log(file.uuid))

To upload files securely, you can use signed uploads.

For the REST API client you must specify both YOUR_PUBLIC_KEY and YOUR_SECRET_KEY:

1import { listOfFiles, UploadcareSimpleAuthSchema } from '@uploadcare/rest-client';
2
3const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
4 publicKey: 'YOUR_PUBLIC_KEY',
5 secretKey: 'YOUR_SECRET_KEY',
6});
7
8const result = await listOfFiles({}, { authSchema: uploadcareSimpleAuthSchema })

Please, read the REST API client’s authentication docs before use it.

Full documentation

Read the full documentation on JS API clients GitHub.