npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-node-dropbox

v2.1.1

Published

Node-RED nodes to watch and download files from Dropbox

Downloads

168

Readme

node-red-node-dropbox

Node-RED nodes to watch, save and retrieve files from Dropbox.

Install

Search for node-red-node-dropbox in the Palette Manager, or run the following command in your Node-RED user directory, ``~/.node-red`:

npm install node-red-node-dropbox

Usage

Watch node

Watches for file events on Dropbox.

By default all file events are reported, but the filename pattern can be supplied to limit the events to files which have full filenames that match the glob pattern.

The event messages consist of the full filename in msg.payload property, the filename in msg.file and the event type in msg.event.

Input node

Downloads content from Dropbox.

The filename on Dropbox is taken from the node filename property or the msg.filename property.

The downloaded content is sent as msg.payload property. If the download fails msg.error will contain an error object.

Output node

Uploads content to Dropbox.

The filename on Dropbox is taken from the node filename property or the msg.filename property.

You can pass in content either as a filename by setting the localFilename field or msg.localFilename property, or you can pass in content directly using msg.payload.

The file will be uploaded to a directory on Dropbox called Apps/{appname}/{appfolder} where {appname} and {appfolder} are set when you set up the Dropbox application key and token.

Dropbox security introduction

Refresh tokens vs Access tokens

The Dropbox security model - to protect access to your files and folders - is improved continiously, which means new versions of this node will need to be implemented to support these changes:

  • Version 1.x of this node used long-live access tokens to access the files and folders of your Dropbox account.
    However Dropbox announced to retire those long-live access tokens on September 30th, 2021. From then on Dropbox requires you to request once a long-live refresh token, which can be used infinitely do request short-live access tokens (which will be valid for only 4 hours).
  • Version 2.0.0 of this node was developed to support refresh tokens.
    This version only allowed refresh tokens to be requested from Dropbox, if your flow editor was opened via a https connection to your Node-RED system. Moreover self signed certificates were not allowed by Dropbox.
  • Version 2.1.0 of this node further improved this mechanism, by allowing refresh tokens to be requested via both http and https connections to Node-RED.

To request once such a refresh token, create a Dropbox config node and follow the instructions on the config node screen step by step. The diagram below summarizes all these steps that need to be executed:

image

Permissions

The tokens only give you access to your Dropbox account, but you still need to apply permissions to these tokens. Which means that you need to specify in your Dropbox account which actions are allowed when somebody logs in via that token. For example:

  • files.content.write: Edit content of your Dropbox files and folders
  • files.content.read: View content of your Dropbox files and folders

Troubleshooting

Some error messages explained:

  • This app has reached its user limit. By default your Dropbox account is only accessible via one domain (e.g. http://my_node_red_domain:1880):

    image

    As a result, you will get this error when you try to access it via multiple domains. In that case you can allow multiple clients via the above "Enable additional users" button.