Skip to content

A Simple Addition to the Dropbox SDK to allow Popup OAuth in browsers

License

Notifications You must be signed in to change notification settings

rogebrd/dropbox-oauth-popup

Folders and files

NameName
Last commit message
Last commit date
Nov 13, 2020
Oct 21, 2021
Oct 17, 2020
Oct 21, 2021
Nov 13, 2020
Oct 15, 2020
Oct 19, 2020
Oct 19, 2020
Oct 19, 2020
Oct 19, 2020
Oct 15, 2020
Oct 21, 2021
Nov 13, 2020
Oct 21, 2021
Oct 21, 2021
Oct 16, 2020

Repository files navigation

Logo

npm npm jsDelivr hits (npm) GitHub package.json dependency version (prod)

This is a simple addition built onto the Dropbox SDK that allows for OAuth in the browser to be done via a popup window.

You can view our documentation on GitHub Pages.

Usage

  1. Create a new instance of the DropboxPopup class
const popup = new DropboxPopup({
    clientId: 'XXXXXXXXXX',
    clientSecret: 'XXXXXXXXXX',
    redirectUri: 'https://XXXXXXXXXX'
});
  1. Run the popup window, giving your callback function for use with the DropboxAuth object
popup.authUser().then((auth) => {
    const dbx = new Dropbox(auth);
}).catch((error) => {
    console.err(error);
})

Distributions

If you are using this via a node project compiled into browser assets, you can install via npm

npm install --save-dev dropbox-oauth-popup

Or you can use it directly in your browser be including the following tag

<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

License

This package is distributed under the MIT license, please see LICENSE for more information.