Registry / security / powr-auth

powr-auth

JSON →
library2.0.8jsnpmunverified

A minimal authentication library for Node.js (v2.0.8) designed for simplicity and rapid setup. It provides basic JWT-based authentication with user registration and login flows. Currently a work in progress with limited documentation and no recent updates; suitable for experimental or internal projects only. Lacks TypeScript definitions and has no notable adoption.

npm install powr-auth
INSTALL
IMPORT
SIG · POWR-AUTH
P
powr-auth
securityjavascriptv2.0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

PowrAuth
import PowrAuth from 'powr-auth'
const PowrAuth = require('powr-auth')
The package exports a single default class; ESM import is the recommended way.
User
import { User } from 'powr-auth'
User type is exported as a named export, but only available if the package ships TypeScript definitions (currently undocumented).
JWT_SECRET
import { JWT_SECRET } from 'powr-auth'
const JWT_SECRET = require('powr-auth').JWT_SECRET
Named constants are exported for configuration; CommonJS requires destructuring.

Shows basic usage of the PowrAuth class for user registration and login, generating a JWT token.

import PowrAuth from 'powr-auth'; const auth = new PowrAuth({ secret: process.env.JWT_SECRET ?? 'fallback-secret', expiresIn: '1h' }); const user = await auth.register({ email: 'user@example.com', password: 'strong-password' }); const token = await auth.login({ email: 'user@example.com', password: 'strong-password' }); console.log('Token:', token);
Debug
Known issues
deprecatedThe package is a work in progress with no major release or updates; consider it experimental.
fix
Use a more established auth library like jsonwebtoken or passport.
affects: >=0.0.0
gotchaNo TypeScript definitions provided; type inference may be incomplete.
fix
Use JSDoc or define custom types manually.
affects: >=2.0.0
gotchaThe package may have unhandled errors for missing configuration options.
fix
Always pass a secret and validate input before calling methods.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'JWT_SECRET')
Missing configuration object when initializing PowrAuth.
fix
Ensure you pass an object with a 'secret' property to the PowrAuth constructor.
Error: register requires email and password
Missing required fields in register method call.
fix
Provide an object with both 'email' and 'password' strings.
Upgrade
Version history
2.0.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
powr-auth — npm install powr-auth · libregistry