@sme-uploader/companion-client
Client library for communication with Companion. Intended for use in SME Uploader plugins.
Example
const SmeUploader = require('@sme-uploader/core');
const { Provider, RequestClient, Socket } = require('@sme-uploader/companion-client');
const uploader = new SmeUploader();
const client = new RequestClient(uploader, { companionUrl: 'https://sme-uploader.mywebsite.com/' });
client.get('/drive/list').then(() => {});
const provider = new Provider(uploader, {
companionUrl: 'https://sme-uploader.mywebsite.com/',
provider: providerPluginInstance
});
provider.checkAuth().then(() => {});
const socket = new Socket({ target: 'wss://sme-uploader.mywebsite.com/' });
socket.on('progress', () => {});
Installation
Unless you are writing a custom provider plugin, you do not need to install this.
$ npm install @sme-uploader/companion-client