Skip to main content

Remote sources

@uppy/remote-sources is a preset plugin (meaning it bundles and sets up other plugins) to add all the available remote sources, such Instagram, Google Drive, Dropbox, and others to Uppy Dashboard in one package.

note

Remote Sources requires Dashboard and automatically installs all its plugins to it.

When should I use it?

@uppy/remote-sources aims to simplify the setup for adding Companion plugins, when you want to share the configuration between plugins. If you want your users to upload files from any of the remote sources that Uppy offers, this plugin is recommended.

A Companion instance is required for the Remote Sources plugin to work. Companion handles authentication with the remote services (such as Facebook, Dropbox, etc.), downloads the files, and uploads them to the destination. This saves the user bandwidth, especially helpful if they are on a mobile connection.

You can self-host Companion or get a hosted version with any Transloadit plan.

Install

npm install @uppy/remote-sources

Use

import Uppy from '@uppy/core';
import Dashboard from '@uppy/dashboard';
import RemoteSources from '@uppy/remote-sources';

import '@uppy/core/dist/style.min.css';
import '@uppy/dashboard/dist/style.min.css';

new Uppy();
.use(Dashboard);
.use(RemoteSources, { companionUrl: 'https://your-companion-url' });

API

Options

id

A unique identifier for this plugin (string, default: RemoteSources).

sources

List of remote sources that will be enabled (array, default: ['Box', 'Dropbox', 'Facebook', 'GoogleDrive','Instagram', 'OneDrive', 'Unsplash', 'Url', 'Zoom']).

You don’t need to specify them manually or change them, but if you want to alter the order in which they appear in the Dashboard, or disable some sources, this option is for you.

uppy.use(RemoteSources, {
companionUrl: 'https://your-companion-url',
sources: ['Instagram', 'GoogleDrive', 'Unsplash', 'Url'],
});

companionUrl

URL to a Companion instance (string, default: null).

companionHeaders

Custom headers that should be sent along to Companion on every request (object, default: {}).

companionAllowedHosts

The valid and authorized URL(s)/URL pattern(s) from which OAuth responses should be accepted (string | RegExp | Array<string | RegExp>, Default: companionUrl).

This value can be a string, a RegExp object, or an array of both.

This is useful when you have your Companion running on several hosts. Otherwise, the default value, which is companionUrl, should do fine.

companionCookiesRule

This option correlates to the Request.credentials value, which tells the plugin whether to send cookies to Companion (string, default: same-origin).

target

DOM element, CSS selector, or plugin to place the drag and drop area into (string, Element, Function, or UIPlugin, default: Dashboard).