Artur Paikin 7ae8af44ab Release 6 years ago
..
src 62305be8b9 companion-client: remove the use of window.location 6 years ago
types 3710b19e1b Use `export =` in @uppy/core typings. 6 years ago
LICENSE f2ee127e81 rename 'server-utils' to 'companion-client' 6 years ago
README.md 67af833fdb More uppy server -> companion renames (#1037) 6 years ago
package.json 7ae8af44ab Release 6 years ago

README.md

@uppy/companion-client

Build Status

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

const Uppy = require('@uppy/core')
const { Provider, RequestClient, Socket } = require('@uppy/companion-client')

const uppy = Uppy()

const client = new RequestClient(uppy, { serverUrl: 'https://uppy.mywebsite.com/' })
client.get('/drive/list').then(() => {})

const provider = new Provider(uppy, {
  serverUrl: '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 --save

License

The MIT License.