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

nextjs-auth-kit

v1.2.1

Published

A package to set up login and signup functionality in Next.js.

Readme

Next.js Auth Setup

A comprehensive authentication setup package for Next.js applications that provides complete authentication functionality, including Google OAuth, email verification, and password management.

Note: Use TypeScript and src folder while creating a new next application


Features

  • 🔐 Complete authentication system
  • 🌐 Google OAuth integration
  • ✉️ Email verification with OTP
  • 🔑 Password management with validation
  • 📱 Responsive UI components
  • 🎯 TypeScript support
  • 🗄️ MongoDB integration
  • 🛡️ Protected routes with middleware

Installation

First install a nextjs project

npx create-next-app@latest

Note: Use TypeScript and src directory while creating a new next application

Then install the package

npm i nextjs-auth-kit

or

npm i nextjs-auth-kit --legacy-peer-deps

Prerequisites

Ensure you have the following before getting started:

  1. Node.js and npm installed
  2. MongoDB database (local or cloud instance)
  3. Google OAuth credentials (Client ID and Secret)
  4. SMTP email service credentials (e.g., Gmail, SendGrid, etc.)

Setup Steps

1. Install the Package

Run the following command in your Next.js project:

npm i nextjs-auth-kit

or

npm i nextjs-auth-kit --legacy-peer-deps

2. Configure Environment Variables

Edit the .env file in your project root and add the following:

MONGODB_URI=your_mongoDB_URI
JWT_SECRET=your_jwt_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret
EMAIL_USER=your_email_user
EMAIL_PASSWORD=your_email_password
NEXT_PUBLIC_APP_URL=http://localhost:3000

Refer this link for Google client and secret id

https://www.balbooa.com/help/gridbox-documentation/integrations/other/google-client-id

Refer this link for Gmail App Password

https://www.getmailbird.com/gmail-app-password/

3. Start Your Development Server

Run the development server with:

npm run dev

Authentication Flow

Email/Password Signup

  1. User enters email and password.
  2. Password validation checks:
    • Minimum 8 characters
    • At least one uppercase letter
    • At least one lowercase letter
    • At least one number
    • At least one special character
  3. OTP is sent to the provided email for verification.
  4. Upon successful verification, the user is redirected to the dashboard.

Google OAuth

  1. User clicks "Continue with Google."
  2. Google login dialog appears for authorization.
  3. Upon success:
    • New users are automatically registered.
    • Existing users are linked to their Google account.
  4. The user is redirected to the dashboard.

Security Features

  1. Password Hashing: Secure passwords using bcrypt.
  2. OTP Expiration: Automatically invalidates OTP after a set time.
  3. Protected API Routes: Ensures restricted access via middleware.
  4. Session Management: Secure sessions with NextAuth.js.
  5. CSRF Protection: Prevents cross-site request forgery attacks.

Contributing

To contribute to the project:

  1. Fork the repository.
  2. Create a feature branch:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m "Add feature description"
  4. Push to the branch:
    git push origin feature-name
  5. Create a Pull Request.

License

This project is licensed under the MIT License.


Authors

  • Sany
  • Kaviyarasan

Support

For any questions or support, you can:


Acknowledgments

Special thanks to the following technologies:

  • Next.js
  • NextAuth.js
  • MongoDB
  • Tailwind CSS