uppy/packages/@uppy/companion-client
Merlijn Vos 7d6937300a
meta: enable prettier for markdown (#5133)
* meta: enable prettier for markdown

* Ignore changelogs

* revert CHANGELOG changes

* More formatting

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-05-02 11:35:55 +02:00
..
src meta: enforce use of .js extension in import type declarations (#5126) 2024-04-29 16:23:28 +02:00
types fixup! Added Companion OAuth Key type (#4668) 2023-09-29 13:51:13 +02:00
.npmignore meta: exclude tsconfig files from npm bundles (#4916) 2024-02-13 23:21:08 +01:00
CHANGELOG.md Release: uppy@3.24.0 (#5040) 2024-03-27 14:57:26 +00:00
LICENSE rename 'server-utils' to 'companion-client' 2018-07-22 18:53:57 +01:00
package.json Release: uppy@3.25.0 (#5127) 2024-04-29 14:35:21 +00:00
README.md meta: enable prettier for markdown (#5133) 2024-05-02 11:35:55 +02:00
tsconfig.build.json @uppy/companion-client: migrate to TS (#4864) 2024-01-24 14:19:38 +01:00
tsconfig.json @uppy/companion-client: fix tests and linter (#4890) 2024-01-24 14:51:21 +01:00

@uppy/companion-client

Uppy logo: a smiling puppy above a pink upwards arrow

npm version CI status for Uppy tests CI status for Companion tests CI status for browser tests

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

License

The MIT License.