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

simple-auth-cli

v1.0.14

Published

An implementation of authentication system supporting multiple providers ready to be used with a single command.

Readme

Simple Auth CLI

npm version license downloads GitHub stars GitHub forks GitHub issues visitors Beta

A robust authentication system implementation supporting multiple providers that can be integrated into your Node.js application with a single command.

Features

Authentication Methods

  • Traditional Authentication

    • Email/Password registration and login
    • Password reset functionality
    • Email verification system
  • OAuth2.0 Providers

    • Google
    • GitHub
    • Spotify
    • (Prepared for Facebook and Microsoft integration)
  • Two-Factor Authentication (2FA)

    • WebAuthn support
    • Biometric authentication
    • Hardware security key support

Additional Security Features

  • JWT-based authentication
  • Refresh token rotation
  • Session management
  • Rate limiting
  • CSRF protection
  • Secure cookie handling

User Management

  • Profile management
  • Avatar upload and management
  • Email change verification
  • Username management
  • Password recovery
  • Account verification

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • Environment variables (see Configuration section)

Installation

npx simple-auth-cli

Quick Start

  1. Initialize the authentication system:
npx simple-auth-cli
  1. Set up your environment variables in .env:
# Database
MONGODB_URI=your_mongodb_uri

# JWT
ACCESS_TOKEN_SECRET=your_access_token_secret
REFRESH_TOKEN_SECRET=your_refresh_token_secret
ACCESS_TOKEN_EXPIRY=1d
REFRESH_TOKEN_EXPIRY=10d

# OAuth Credentials
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_TOKEN_HOST=https://oauth2.googleapis.com

GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_TOKEN_HOST=https://github.com

SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
SPOTIFY_TOKEN_HOST=https://accounts.spotify.com

# Similarly add for other providers

# Cloudinary (for avatar storage)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

# Email Service
RESEND_API_KEY=your_resend_api_key

# Application
APPNAME=your_app_name
APPURL=your_app_url

API Endpoints

Authentication

  • POST /api/v1/users/register - Register new user
  • POST /api/v1/users/login - Login user
  • POST /api/v1/users/logout - Logout user
  • POST /api/v1/users/generateNewTokens - Refresh access token

OAuth

  • GET /api/v1/users/oauth - Initialize OAuth flow
  • GET /api/v1/users/auth/oauth/:provider/callback - OAuth callback URLs

Account Management

  • POST /api/v1/users/verify - Verify email
  • POST /api/v1/users/forgotPassword - Request password reset
  • POST /api/v1/users/changePassword - Change password
  • POST /api/v1/users/changeEmail - Change email
  • POST /api/v1/users/changeUserName - Change username
  • PATCH /api/v1/users/updateAvatar - Update profile picture

Two-Factor Authentication

  • POST /api/v1/users/initialize2FA - Setup 2FA
  • POST /api/v1/users/verify2FA - Verify 2FA
  • POST /api/v1/users/verify2FALogin - Login with 2FA

Security Considerations

  • All passwords are hashed using bcrypt
  • JWTs are stored in HTTP-only cookies
  • File upload validation
  • Email verification required for critical actions

Error Handling

The system implements a centralized error handling mechanism with detailed error messages and appropriate HTTP status codes.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.