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-it

v1.6.5

Published

A comprehensive authentication package providing:

Readme

auth-it

A comprehensive authentication package providing:

OAuth authentication with Google, GitHub, Microsoft, and Okta.
JWT token generation and verification.
Secure password hashing.
OTP (One-Time Password) functionality.

This package is designed to be easy to integrate into your application, providing flexible and secure user authentication.


📑 Table of Contents


🚀 Features

| Feature | Description | |------------------------|-------------| | 🔐 JWT Authentication | Securely sign and verify JSON Web Tokens. | | 🔑 OAuth Authentication | Integrate authentication with Google, GitHub, Microsoft, and Okta. | | 🔏 Password Hashing | Safely hash and validate user passwords using SHA-512. | | 🔢 OTP Authentication | Generate and verify OTPs for added security. |


📥 Installation

Using npm:

npm install auth-it

Using yarn:

yarn add auth-it

⚙️ Environment Variables

To use the package, configure the following environment variables in your .env file.

# For Okta
OKTA_ISSUER=https://your-okta-domain.okta.com/oauth2/default
OKTA_CLIENT_ID=your-okta-client-id
OKTA_CLIENT_SECRET=your-okta-client-secret
OKTA_REDIRECT_URI=http://localhost:3000/callback

# For Microsoft
TENANT_ID=your-microsoft-tenant-id

# JWT Secret Key
JWT_SECRET_KEY=your-jwt-secret-key

Replace placeholder values with your actual credentials.


📌 Usage

To use this package, import the required authentication service as shown below:

1️⃣ Basic Authentication (Hash Service)

import { hashService } from 'auth-it';

// Create Salt
const salt = hashService.createSalt();
console.log(salt);

// Hash Password
const hashedPassword = hashService.hashPassword('userPassword', salt);
console.log(hashedPassword);

// Validate Password
const isValid = hashService.validatePassword('userPassword', salt, hashedPassword);
console.log(isValid); // true or false

// Generate JWT Token
const token = hashService.generateJwt({ userId: '123' });
console.log(token);

// Verify JWT Token
const decoded = hashService.verifyToken(token);
console.log(decoded);

2️⃣ Social Authentication (OAuth Service)

import { oauthService } from 'auth-it';

// Get OAuth Authorization URL
const authUrl = oauthService.getAuthURL('google', {
  clientId: 'your-client-id',
  redirectUri: 'http://localhost:3000/callback',
  scope: 'openid email profile',
});
console.log(authUrl);

// Get Access Token
const token = await oauthService.getToken('google', 'authorization-code', {
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  redirectUri: 'http://localhost:3000/callback',
});
console.log(token);

// Get User Info
const userInfo = await oauthService.getUserInfo('google', token);
console.log(userInfo);

3️⃣ OTP Authentication (OTP Service)

import { otpService } from 'auth-it';

// Send OTP via Email
const otp = await otpService.SendEmailtoOtp('[email protected]');
console.log(otp);

// Verify OTP
const isVerified = otpService.verifyOtp('[email protected]', '123456');
console.log(isVerified); // true or false

📜 License

This package is licensed under the ISC License.


🚀 Now you're ready to integrate auth-it into your application!


Created by Kathan Adalaja 🚀