![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
box-appauth
Advanced tools
https://box-content.readme.io/v2.0/docs/app-auth
You will need to create a .credentials.js
folder in the root of the application using this module.
This file should look something like:
"use strict";
var fs = require('fs');
var path = require('path');
module.exports = {
publicKey : fs.readFileSync(path.resolve('./rsa/public_key.pem')),
privateKey : fs.readFileSync(path.resolve('./rsa/private_key.pem')),
algorithm : 'RS256',
issuer : '<same as #clientId>',
subject : '<an app id(#user) or enterprise id(#enterprise)>',
subjectType : '<user or enterprise>',
clientId : '<your client id>',
clientSecret : '<you client Secret>'
};
With above, you will need to create proper public/private keys, register them with Box, and include them in your .credentials.js
file.
Then simply
var appAuth = require('box-appauth');
appAuth(requireCredentialsSomehow())
.then(function(api) {
...do something with the Promise based api
api.folders
.methodA({...})
.then(function(resultOfMethodA) {
return api.folder.methodB()
})
.then(function(resultOfMethodB) {
// etc across as many calls as you'd like, all
// executed "sequentially".
})
.catch(function(err) {
...
})
})
.catch(function(err) {
console.log("** Unable to authenticate **", err);
});
FAQs
https://box-content.readme.io/v2.0/docs/app-auth
The npm package box-appauth receives a total of 34 weekly downloads. As such, box-appauth popularity was classified as not popular.
We found that box-appauth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.