Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 2.54 KB

remote-sources.md

File metadata and controls

78 lines (52 loc) · 2.54 KB
type order title module permalink category tagline
docs
10
Remote Sources
@uppy/remote-sources
docs/remote-sources/
Miscellaneous
Uppy plugin that includes all remote sources that Uppy+Companion offer, like Instagram, Google Drive, Dropox, Box, Unsplash, Url etc

@uppy/remote-sources is a preset plugin 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.

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

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

Installation

This plugin is published as the @uppy/remote-sources package.

npm install @uppy/remote-sources

In the CDN package, the plugin class is available on the Uppy global object:

const { RemoteSources } = Uppy

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']).

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) from which OAuth responses should be accepted (string | RegExp | Array<string | RegExp>, Default: companionUrl)

This value can be a String, a Regex pattern, 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 RequestCredentials value, which tells the plugin whether to send cookies to Companion (string, default: same-origin).