Docs
- Getting Started
- Uppy
- Companion
- List of Plugins
- Common Plugin Options
- Custom Stores
- Community Projects
- Locale Packs
- Migration guides
UI Elements
Sources
- Drag & Drop
- Drop Target
- File Input
- Audio
- Webcam
- Screen capture
- Provider Plugins
- ⓒ Box
- ⓒ Dropbox
- ⓒ Google Drive
- ⓒ OneDrive
- ⓒ Zoom
- ⓒ Unsplash
- ⓒ Import From URL
Destinations
Miscellaneous
React
- Introduction
- <StatusBar />
- <DragDrop />
- <FileInput />
- <ProgressBar />
- <Dashboard />
- <DashboardModal />
- React Native
Other Integrations
Contributing
The @uppy/facebook
plugin lets users import files from their Facebook account.
A Companion instance is required for the @uppy/facebook
plugin to work. Companion handles authentication with Facebook, downloads the pictures and videos, and uploads them to the destination. This saves the user bandwidth, especially helpful if they are on a mobile connection.
import Facebook from '@uppy/facebook' uppy.use(Facebook, { // Options }) |
Installation
If you are using the
uppy
package, you do not need to install this plugin manually.
This plugin is published as the @uppy/facebook
package.
Install from NPM:
npm install @uppy/facebook |
OAuth
You need to set up OAuth in your Facebook app for Companion to be able to connect to users’ Facebook accounts. You have to enable “Advanced Access” for the user_photos
permission. A precondition of that is “Business Verification” which involves setting up a Meta Business Account and submitting documents to prove business ownership.
CSS
Dashboard plugin is recommended as a container to all Provider plugins, including Facebook. If you are using Dashboard, it comes with all the necessary styles for Facebook as well.
⚠️ If you are feeling adventurous, and want to use Facebook plugin separately, without Dashboard, make sure to include @uppy/provider-views/dist/style.css
(or style.min.css
) CSS file. This is experimental, not officially supported and not recommended.
Options
The @uppy/facebook
plugin has the following configurable options:
uppy.use(Facebook, { target: Dashboard, companionUrl: 'https://companion.uppy.io/', }) |
id: 'Facebook'
A unique identifier for this plugin. It defaults to 'Facebook'
.
title: 'Facebook'
Configures the title / name shown in the UI, for instance, on Dashboard tabs. It defaults to 'Facebook'
.
target: null
DOM element, CSS selector, or plugin to mount the Facebook provider into. This should normally be the @uppy/dashboard
plugin.
companionUrl: null
URL to a Companion instance.
companionHeaders: {}
Custom headers that should be sent along to Companion on every request.
companionAllowedHosts: companionUrl
The valid and authorized URL(s) from which OAuth responses should be accepted.
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 should be good enough.
companionCookiesRule: 'same-origin'
This option correlates to the RequestCredentials value, which tells the plugin whether to send cookies to Companion.
locale: {}
export default { strings: { pluginNameFacebook: 'Facebook', }, } |