Registry / auth-security / auth-box

auth-box

JSON →
library0.0.68jsnpmunverified

auth-box is an authentication library for Node.js >=6 that aims to provide a unified interface for multiple authentication providers. Currently at version 0.0.68, it is in early development with an unstable API and frequent breaking changes. Key differentiator: attempts to abstract away the differences between various auth services into a single 'auth box' but lacks documentation and maturity.

npm install auth-box
INSTALL
IMPORT
SIG · AUTH-BOX
A
auth-box
auth-securityjavascriptv0.0.68
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AuthBox
import AuthBox from 'auth-box'
const AuthBox = require('auth-box'); // Wrong: No default export in some versions
The package may not have proper ESM exports; check package.json for exports field.
authenticate
import { authenticate } from 'auth-box'
const authenticate = require('auth-box').authenticate; // May work but not recommended in ESM context
Named export, but depends on bundler/Node version.
Providers
import { Providers } from 'auth-box'
import { providers } from 'auth-box';
Providers is an enum/object with lowercase keys, but export is capitalized.

Initializes AuthBox with OAuth configs for Google and GitHub, then authenticates a user with an authorization code.

import AuthBox, { authenticate, Providers } from 'auth-box'; const config = { google: { clientId: process.env.GOOGLE_CLIENT_ID ?? '', clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '' }, github: { clientId: process.env.GITHUB_CLIENT_ID ?? '', clientSecret: process.env.GITHUB_CLIENT_SECRET ?? '' } }; const box = new AuthBox(config); async function main() { try { const user = await authenticate('google', { code: 'auth_code' }); console.log(user); } catch (err) { console.error('Authentication failed:', err.message); } } main();
Debug
Known issues
breakingToken storage changed from synchronous to asynchronous in v0.0.50
fix
Update code to handle async token storage; see migration guide (if any).
affects: <0.0.50
deprecatedProvider 'twitter' is deprecated and will be removed in v1.0
fix
Use 'twitter-v2' provider instead.
affects: >=0.0.60
gotchaThe package has no README or documentation. API is inferred from source code and may change without notice.
fix
Pin exact version and extensively test on upgrade.
affects: *
gotchaAuthBox constructor throws if any required config field is missing; error messages are unhelpful.
fix
Ensure all provider config objects include required fields as per source comments.
affects: *
Errors
Common errors & fixes
TypeError: Cannot read property 'access_token' of undefined
OAuth token response is malformed or provider returns error without proper handling.
fix
Check network request; ensure redirect URI matches provider settings. Use try-catch around authenticate().
Error: Provider 'facebook' not supported
The provider name is not in the supported list or typo.
fix
Use one of the supported provider names from the Providers enum; check for exact casing.
Upgrade
Version history
0.0.68latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
30
OpenAI (training)
1
Resources
auth-box — npm install auth-box · libregistry