npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

auth-nexus

v1.0.2

Published

A comprehensive authentication package for Node.js applications with MongoDB, JWT, email verification, and webhook support

Readme

Auth Nexus

A comprehensive, production-ready authentication package for Node.js applications with MongoDB, JWT tokens, email verification, and webhook support.

Features

  • 🔐 Complete Authentication System - Registration, login, logout
  • 📧 Email Verification - Automated email verification with customizable templates
  • 🔑 Password Reset - Secure password reset functionality
  • 🎣 Webhook Support - Real-time event notifications
  • 🛡️ JWT Authentication - Secure token-based authentication
  • 📱 Client SDK - Easy-to-use client library
  • 🔒 Security Best Practices - Bcrypt hashing, input validation
  • 🚀 Easy Integration - Simple setup and configuration

Installation

```bash npm install auth-nexus ```

Quick Start

```javascript const express = require('express'); const { AuthCore } = require('auth-nexus');

const app = express(); const authCore = new AuthCore({ mongoURI: 'mongodb://localhost:27017/myapp', jwtSecret: 'your-secret-key' });

(async () => { await authCore.initialize(); app.use('/auth', authCore.getRouter()); app.listen(3000); })(); ```

Configuration

Basic Configuration

```javascript const authCore = new AuthCore({ mongoURI: 'mongodb://localhost:27017/myapp', jwtSecret: 'your-secret-key', baseUrl: 'http://localhost:3000' }); ```

Email Configuration

```javascript const authCore = new AuthCore({ // ... basic config emailConfig: { enabled: true, service: 'gmail', user: '[email protected]', password: 'your-app-password', from: '[email protected]' } }); ```

Webhook Configuration

```javascript const authCore = new AuthCore({ // ... basic config webhookConfig: { enabled: true, webhooks: [ { url: 'https://your-app.com/webhooks/auth', events: ['user.registered', 'user.login', 'user.verified'] } ] } }); ```

API Endpoints

| Method | Endpoint | Description | |--------|----------|-------------| | POST | /auth/register | Register a new user | | POST | /auth/login | Login user | | GET | /auth/me | Get current user profile | | POST | /auth/verify-email | Verify email address | | POST | /auth/forgot-password | Request password reset | | POST | /auth/reset-password | Reset password |

Client SDK Usage

```javascript const { AuthClient } = require('auth-nexus');

const client = new AuthClient('http://localhost:3000/auth');

// Register const result = await client.register({ email: '[email protected]', password: 'password123', firstName: 'John', lastName: 'Doe' });

// Login await client.login('[email protected]', 'password123');

// Get profile const profile = await client.getProfile(); ```

Middleware Usage

```javascript const { AuthMiddleware } = require('auth-nexus');

app.get('/protected', AuthMiddleware(authCore.config), (req, res) => { res.json({ user: req.user }); }); ```

Webhook Events

The following events are triggered:

  • user.registered - When a new user registers
  • user.login - When a user logs in
  • user.verified - When a user verifies their email
  • password.reset - When a user resets their password

Environment Variables

```env MONGO_URI=mongodb://localhost:27017/auth-nexus JWT_SECRET=your-super-secret-jwt-key BASE_URL=http://localhost:3000 [email protected] EMAIL_PASSWORD=your-email-password ```

License

MIT

Contributing

Pull requests are welcome. For major changes, please open an issue first.