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';
const dropboxConfig = {
folderName: 'YOUR_FOLDER_NAME',
appKey: 'YOUR_APP_KEY',
redirectUri: 'YOUR_APP_REDIRECT_URI'
};
const dropbox = new Dropbox(dropboxConfig);
dropbox.authenticate().then(token => {
console.log(token);
});
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