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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@theagentverse/github-login-button

v1.0.3

Published

A CLI tool that installs a GitHub OAuth login button + Next.js OAuth callback handler.

Readme

🐙 GitHub Login Button + OAuth Callback (Next.js)

A plug-and-play GitHub OAuth Login Button for any Next.js application.
This component handles GitHub authentication end-to-end, including redirecting the user, exchanging the OAuth code, and fetching their GitHub profile.


✨ Features

1. One-Click GitHub Login

  • Fully functional GitHub OAuth login flow
  • Works instantly after adding your Client ID

2. Ready-Made Login Button

  • Styled GitHub login button component
  • Mobile-friendly and accessible
  • Clean, modern UI

3. OAuth Backend Included

  • /api/auth/callback route
  • Exchanges OAuth code for access token
  • Fetches GitHub user profile
  • Redirects user with name/email

4. Easy Integration

| Task | Manual Time | With This Package | |------|-------------|------------------| | OAuth setup | 2–4 hours | 0 | | Login button UI | 1 hour | 0 | | Server OAuth handler | 2 hours | 0 | | Redirect handling | 30–60 min | 0 |

Total saved: 5–7 hours → Setup in minutes


🚀 Quick Start

Install Using npx

npx @theagentverse/github-button-agent-cli init

Output Files After Setup

  • src/app/api/auth/callback/route.ts
  • src/app/components/GitHubLoginButton.tsx
  • .env.local template added automatically

🧠 How It Works

User clicks GitHub button
→ Redirected to GitHub OAuth
→ User approves access
→ GitHub returns "code"
→ Next.js API exchanges "code" for access token
→ Fetch user profile
→ Redirect back to your site with user info

📁 Folder Structure

project/
│
├── src/
│   ├── app/
│   │   └── api/
│   │       └── auth/
│   │           └── callback/
│   │               └── route.ts
│   └── components/
│       └── GitHubLoginButton.tsx
│
└── .env.local (generated)

⚙️ Required Environment Variables

Create .env.local:

GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret

You can generate these in your GitHub OAuth App settings.


🛠 Requirements

  • Next.js 13+ (App Router)
  • Node.js 18+
  • GitHub OAuth App

🐾 Button Component Example

The generated file contains:

  • Login button
  • GitHub SVG icon
  • OAuth redirect builder
  • Environment variable checks
  • Smooth UI styling

🔄 API Callback Flow

The generated route:

  • Validates URL code parameter
  • Exchanges OAuth code for access token
  • Fetches GitHub profile data
  • Redirects user to / with name and success=true

📄 License

MIT License


⭐ Why Use This?

  • Works immediately with zero configuration
  • Removes OAuth complexity
  • Clean UI + backend ready
  • Saves hours of setup time
  • Ideal for dashboards, login pages, and dev tools

Add GitHub authentication to your Next.js app in minutes, not hours.