npm dropbox 3.0.0
v3.0.0

latest releases: 10.34.0, 10.33.0, 10.32.0...
6 years ago

This release will be a major version bump. Major features in this release are:

  1. Add fetch for requests and remove superagent. Special thanks to James Sidhu!
  2. Change how Dropbox and DropboxTeam are exposed, for consistency.

These are backward incompatible. Going forward, imports change, and developers need to bring their own fetch library.

//Node.js
var Dropbox = require('dropbox').Dropbox;
or 
var DropboxTeam = require('dropbox').DropboxTeam;
require(‘isomorphic-fetch’); // or require(‘node-fetch’) if only running node
const dbx = new Dropbox({ accessToken: 'YOUR_ACCESS_TOKEN_HERE'});

On the web and on most modern browsers, fetch should be available (List of supported browsers). Otherwise, use the polyfill below (for example), or use an npm package such as whatwg-fetch.

<script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script>
<script src="https://unpkg.com/dropbox/dist/DropboxTeam-sdk.min.js"></script>
<!-- Optional. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.js"></script>
var dbx = new Dropbox.Dropbox({ accessToken: getAccessTokenFromUrl() });

Other new features include:

  1. Add support for select-admin header.
  2. Support app auth method for rpc requests which will enable authTokenFromOauth1
    var Dropbox = require('dropbox').Dropbox;
    var dbx = new Dropbox({ clientId: "...", clientSecret: "..." });
    dbx.authTokenFromOauth1({"oauth1_token": "...", "oauth1_token_secret": "..."}).
        then(function(response) {
            console.log(response.oauth2_token);
        })
        .catch(function(error){
            console.log(error);
        });
  1. Add a getAccessTokenFromCode method. With this, the code authorization flow is now fully supported. There is an example at code_flow_example.js. Thanks to b-dur!
  2. Bug Fixes:
    a. #169
    b. #158
    c. #138
    d. #114
  3. Stone and spec updates
  - team_common namespace:
    - Added new MemberSpaceLimitType union
  - team  namespace:
    - add additional error types to MembersRemoveError union
    - updated docstring
  - users namespace:
    - additional member space limit fields in TeamSpaceAllocation struct
  - team_log namespace:
    - lots of updates to struct names and descriptions (note these routes and structs are still in preview and subject to further changes)

Don't miss a new dropbox release

NewReleases is sending notifications on new releases.