This package provides a programmatically generated wrapper for the Dropbox V2 API, specifically designed for Node.js environments. It aims to keep the API surface up-to-date by automatically generating PRs when the official Dropbox endpoint descriptions change. Currently at version 2.5.12, it follows a continuous update model for its API generation, ensuring parity with the Dropbox API. Key differentiators include full support for Node.js streams for efficient file uploads and downloads, direct support for the Dropbox Paper API, and a simple, direct mapping of official Dropbox API resource names. It avoids custom function names, instead relying on a structured object for resource and parameter definitions. The package supports both token-based authentication and the full OAuth2 flow, including refresh token management for offline access. It is primarily consumed as a CommonJS module.
Verified import paths — ran on the pinned version, not inferred.
The library primarily uses CommonJS `require()` syntax. Direct ESM `import` is not officially supported without a transpilation step or specific `type: module` configuration in consuming applications. The main export is an object containing the `authenticate` method.
The `authenticate` method is accessed via the `dropboxV2Api` object. It returns a function (`dropbox`) that is then used to make API calls. Do not try to destructure `authenticate` directly from the `require` call unless you are certain of the module's export structure.
After authentication, the returned `dropbox` function is the primary interface for all API calls. It takes a single configuration object with `resource` (string) and `parameters` (object) fields, following the official Dropbox API endpoint naming conventions.
This example demonstrates authenticating with a Dropbox token, fetching current account details, and uploading a local file to Dropbox using Node.js streams. It highlights the basic API call structure.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.