Skip to content

Commit

Permalink
Merge pull request #1293 from remotestorage/rosano-patch-2
Browse files Browse the repository at this point in the history
Document set global.fetch
  • Loading branch information
raucao committed Mar 27, 2023
2 parents aecac4f + 80256fd commit 1fc201d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/nodejs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Although remoteStorage.js was initially written for being used in browsers, we
do support using it in a Node.js environment as well. See :doc:`this section
</getting-started>` for getting started.

.. HINT::
Node 18 includes ``fetch`` natively, but earlier versions do not, and so it
may be necessary to set ``global.fetch`` with a polyfill such as `node-fetch`_.

.. _node-fetch: https://www.npmjs.com/package/node-fetch

The main difference between rs.js in a browser and using it on a server or in a
CLI program is how to connect a storage. The RS protocol uses the OAuth
Implicit Grant flow for clients to receive a bearer token, which they can use
Expand Down

0 comments on commit 1fc201d

Please sign in to comment.