Registry / auth-security / detexter-auth-kit

detexter-auth-kit

JSON →
library1.0.4jsnpmunverified

REWRITE: detexter-auth-kit v1.0.4 is a lightweight JWT authentication toolkit for Express.js, providing middleware and utilities for token signing, verification, and route protection. It uses the jsonwebtoken library under the hood. The package is currently in early stages with minimal configuration; future updates may include more robust options. Alternatives like express-jwt offer more features but are heavier. Release cadence is unknown.

npm install detexter-auth-kit
INSTALL
IMPORT
SIG · DETEXTER-AUTH-KIT
D
detexter-auth-kit
auth-securityjavascriptv1.0.4
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

authMiddleware
import { authMiddleware } from 'detexter-auth-kit'
import authMiddleware from 'detexter-auth-kit'
Named export, not default. CommonJS: const { authMiddleware } = require('detexter-auth-kit')
signToken
import { signToken } from 'detexter-auth-kit'
const signToken = require('detexter-auth-kit').signToken
Named export, works in both ESM and CJS
verifyToken
import { verifyToken } from 'detexter-auth-kit'
import { verify } from 'detexter-auth-kit'
Exact function name is verifyToken, not verify

Shows login token generation and protected route with middleware; includes secret from environment variable.

import express from 'express'; import { authMiddleware, signToken, verifyToken } from 'detexter-auth-kit'; const app = express(); app.use(express.json()); app.post('/login', (req, res) => { const payload = { id: 1, email: 'user@example.com' }; const token = signToken(payload, { secret: process.env.JWT_SECRET ?? 'fallback', expiresIn: '1h' }); res.json({ token }); }); app.get('/profile', authMiddleware({ secret: process.env.JWT_SECRET ?? 'fallback' }), (req, res) => { res.json({ user: req.user }); }); app.listen(3000, () => console.log('Server running on port 3000'));
Debug
Known issues
breakingPackage name 'detexter-auth-kit' is not the same as 'express-auth-kit' used in README imports (require("express-auth-kit") will fail).
fix
Use correct package name: require('detexter-auth-kit')
affects: >=1.0.0
deprecatedThe secret option in signToken and authMiddleware should not be hardcoded; use environment variables. Future versions may enforce this.
fix
Store secret in process.env.JWT_SECRET and use it in options.
affects: >=0.0.0
gotchaMissing token in Authorization header results in 401 with generic error message; no custom error handling.
fix
Implement your own error handling middleware to provide more context.
affects: >=0.0.0
gotchaauthMiddleware expects 'Authorization: Bearer <token>' header; other formats (e.g., 'token') are rejected.
fix
Ensure client sends 'Bearer' prefix.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Cannot destructure property 'secret' of 'options' as it is undefined
authMiddleware or signToken called without options object or missing secret property.
fix
Call authMiddleware({ secret: 'your-secret' }) or signToken(payload, { secret: 'your-secret' })
Error: secretOrPrivateKey must have a value
Secret is empty or undefined when calling signToken or verifyToken.
fix
Provide a non-empty string as secret; check environment variable is set.
JsonWebTokenError: jwt malformed
Token string is corrupted, not a valid JWT, or contains extra whitespace.
fix
Ensure token is exactly the JWT string; remove any extra quotes or spaces.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
jsonwebtokenrequiredRequired for signToken and verifyToken functions
Agent activity
12 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
detexter-auth-kit — npm install detexter-auth-kit · libregistry