项目作者: rogebrd

项目描述 :
A Simple Addition to the Dropbox SDK to allow Popup OAuth in browsers
高级语言: JavaScript
项目地址: git://github.com/rogebrd/dropbox-oauth-popup.git
创建时间: 2020-10-15T02:12:25Z
项目社区:https://github.com/rogebrd/dropbox-oauth-popup

开源协议:MIT License

下载


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
  1. const popup = new DropboxPopup({
  2. clientId: 'XXXXXXXXXX',
  3. clientSecret: 'XXXXXXXXXX',
  4. redirectUri: 'https://XXXXXXXXXX'
  5. });
  1. Run the popup window, giving your callback function for use with the DropboxAuth object
  1. popup.authUser().then((auth) => {
  2. const dbx = new Dropbox(auth);
  3. }).catch((error) => {
  4. console.err(error);
  5. })

Distributions

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

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

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

  1. <script src="https://cdn.jsdelivr.net/npm/dropbox-oauth-popup@3.1.0"></script>

License

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