{"id":26747,"library":"auth-express","title":"auth-express","description":"A middleware library for Express.js that provides a unified authentication box supporting multiple strategies (JWT, OAuth, session, etc.). Current stable version 0.0.62 (as of 2025) with minimal release cadence (no recent updates). Key differentiator: single-box configuration for auth, but lacks documentation and appears unmaintained. Alternatives like passport or express-jwt are more robust.","status":"abandoned","version":"0.0.62","language":"javascript","source_language":"en","source_url":"https://github.com/rocket-monkey/auth-box","tags":["javascript"],"install":[{"cmd":"npm install auth-express","lang":"bash","label":"npm"},{"cmd":"yarn add auth-express","lang":"bash","label":"yarn"},{"cmd":"pnpm add auth-express","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is ESM-only since v0.0.50. CommonJS require will fail.","wrong":"const auth = require('auth-express')","symbol":"default","correct":"import auth from 'auth-express'"},{"note":"Named export available; use for custom configuration.","wrong":"","symbol":"Auth","correct":"import { Auth } from 'auth-express'"},{"note":"CommonJS destructuring is not supported; use ESM import.","wrong":"const { verifyToken } = require('auth-express')","symbol":"verifyToken","correct":"import { verifyToken } from 'auth-express'"}],"quickstart":{"code":"import express from 'express';\nimport auth from 'auth-express';\n\nconst app = express();\napp.use(auth({ secret: process.env.JWT_SECRET ?? 'default-secret' }));\n\napp.get('/protected', auth.required, (req, res) => {\n  res.json({ user: req.user });\n});\n\napp.listen(3000, () => console.log('Server running on port 3000'));","lang":"typescript","description":"Initializes auth middleware with JWT secret and protects a route using auth.required guard."},"warnings":[{"fix":"Migrate to a maintained authentication library.","message":"auth-express is no longer maintained. Use passport or express-jwt instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use ES module syntax: import auth from 'auth-express'","message":"Version 0.0.60 dropped support for CommonJS (require). Only ESM imports are allowed.","severity":"breaking","affected_versions":">=0.0.60"},{"fix":"Use app.use(auth(options)) instead of app.use(auth)","message":"The default export is a factory function, not middleware directly. Must call it with options first.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install auth-express","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'auth-express'"},{"fix":"Provide options: auth({ secret: 'mysecret' })","cause":"Missing required options object when calling auth().","error":"TypeError: Cannot read properties of undefined (reading 'secret')"},{"fix":"Switch to import statement: import auth from 'auth-express'","cause":"Using CommonJS require() on an ESM-only module.","error":"SyntaxError: The requested module 'auth-express' does not provide an export named 'default'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}