{"id":18132,"library":"auth-box","title":"auth-box","description":"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.","status":"active","version":"0.0.68","language":"javascript","source_language":"en","source_url":"https://github.com/rocket-monkey/auth-box","tags":["javascript"],"install":[{"cmd":"npm install auth-box","lang":"bash","label":"npm"},{"cmd":"yarn add auth-box","lang":"bash","label":"yarn"},{"cmd":"pnpm add auth-box","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package may not have proper ESM exports; check package.json for exports field.","wrong":"const AuthBox = require('auth-box');\n// Wrong: No default export in some versions","symbol":"AuthBox","correct":"import AuthBox from 'auth-box'"},{"note":"Named export, but depends on bundler/Node version.","wrong":"const authenticate = require('auth-box').authenticate;\n// May work but not recommended in ESM context","symbol":"authenticate","correct":"import { authenticate } from 'auth-box'"},{"note":"Providers is an enum/object with lowercase keys, but export is capitalized.","wrong":"import { providers } from 'auth-box';","symbol":"Providers","correct":"import { Providers } from 'auth-box'"}],"quickstart":{"code":"import AuthBox, { authenticate, Providers } from 'auth-box';\n\nconst config = {\n  google: {\n    clientId: process.env.GOOGLE_CLIENT_ID ?? '',\n    clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? ''\n  },\n  github: {\n    clientId: process.env.GITHUB_CLIENT_ID ?? '',\n    clientSecret: process.env.GITHUB_CLIENT_SECRET ?? ''\n  }\n};\n\nconst box = new AuthBox(config);\n\nasync function main() {\n  try {\n    const user = await authenticate('google', { code: 'auth_code' });\n    console.log(user);\n  } catch (err) {\n    console.error('Authentication failed:', err.message);\n  }\n}\n\nmain();","lang":"typescript","description":"Initializes AuthBox with OAuth configs for Google and GitHub, then authenticates a user with an authorization code."},"warnings":[{"fix":"Update code to handle async token storage; see migration guide (if any).","message":"Token storage changed from synchronous to asynchronous in v0.0.50","severity":"breaking","affected_versions":"<0.0.50"},{"fix":"Use 'twitter-v2' provider instead.","message":"Provider 'twitter' is deprecated and will be removed in v1.0","severity":"deprecated","affected_versions":">=0.0.60"},{"fix":"Pin exact version and extensively test on upgrade.","message":"The package has no README or documentation. API is inferred from source code and may change without notice.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure all provider config objects include required fields as per source comments.","message":"AuthBox constructor throws if any required config field is missing; error messages are unhelpful.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Check network request; ensure redirect URI matches provider settings. Use try-catch around authenticate().","cause":"OAuth token response is malformed or provider returns error without proper handling.","error":"TypeError: Cannot read property 'access_token' of undefined"},{"fix":"Use one of the supported provider names from the Providers enum; check for exact casing.","cause":"The provider name is not in the supported list or typo.","error":"Error: Provider 'facebook' not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}