🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

dbox-sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbox-sdk

Unofficial Dropbox SDK for green browsers based on using ES6 syntax

1.0.0
latest
Source
npm
Version published
Weekly downloads
8
300%
Maintainers
1
Weekly downloads
 
Created
Source

Dropbox SDK for JavaScript

Unofficial Dropbox SDK for green browsers based on using ES6 syntax

Install

npm install dropboxsdk --save

Example

import Dropbox from './dropbox-sdk.js';

// Make instance config and first call 
const dropboxConfig = {
  folderName: 'YOUR_FOLDER_NAME',
  appKey: 'YOUR_APP_KEY',
  redirectUri: 'YOUR_APP_REDIRECT_URI'//example: http://localhost:8000
};
const dropbox = new Dropbox(dropboxConfig);
// Show authenticate dialog and get token (token autosave to localStorage in '__db_token' key)
dropbox.authenticate().then(token => {
  console.log(token);
});
// Call request API. Example get_space_usage
dropbox.request({
  host: 'https://api.dropboxapi.com',
  query: '/2/users/get_space_usage',
  method: 'POST',
  type: String,
  body: 'null',
  headers: {
    type: 'application/json'
  }
})
.then(data => console.log(data))

Warning!

The API have not run on old browsers have not support:

  • fetch API
  • Promise API
  • Classes declaration
  • ES6 modules

Keywords

dropbox

FAQs

Package last updated on 24 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts