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

gs-error-reporter

v1.0.3

Published

Runtime error monitoring and email reporting for Next.js

Readme

GS Error Reporter

Lightweight email-first error monitoring for Next.js.

Capture client and server runtime errors and receive structured and formatted email reports in minutes.


📸 Preview

CLI Setup

CLI

Email Report

Email Screenshot

Email Screenshot


Why GS Error Reporter?

Most small and medium Next.js projects don't need expensive monitoring platforms or complex dashboards.

GS Error Reporter focuses on one thing:

Receive detailed error reports directly in your inbox with almost no setup.

No dashboards.

No external monitoring service.

No monthly subscription.

Just install, configure, and receive detailed reports whenever something goes wrong.


Features

Error Monitoring

  • ✅ Client-side runtime errors
  • ✅ Server-side runtime errors
  • ✅ Unhandled Promise Rejections
  • ✅ Console Errors
  • ✅ Console Warnings

Reporting

  • ✅ Structured HTML email reports
  • ✅ Stack traces
  • ✅ Request information
  • ✅ Environment details
  • ✅ Browser information
  • ✅ Additional metadata

Developer Experience

  • ✅ One CLI setup
  • ✅ Automatic file generation
  • ✅ Supports App Router
  • ✅ Supports Pages Router
  • ✅ TypeScript support

Why choose GS Error Reporter?

| Feature | GS Error Reporter | Manual Logging | |----------|-------------------|----------------| | Email Alerts | ✅ | ❌ | | Auto Setup | ✅ | ❌ | | Stack Trace | ✅ | ⚠️ | | Request Context | ✅ | ❌ | | HTML Reports | ✅ | ❌ | | Zero Dashboard | ✅ | ❌ |


Quick Start

1. Install

npm install gs-error-reporter

or

pnpm add gs-error-reporter

or

yarn add gs-error-reporter

2. Run Setup

npx gs-error-reporter

Example output:

✔ Next.js project detected

✔ App Router detected

✔ Created instrumentation.ts

✔ Created API route

✔ Updated environment variables

✔ Setup complete

3. Add GSReporter

App Router

import { GSReporter } from "gs-error-reporter";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <GSReporter />
      <body>{children}</body>
    </html>
  );
}

Pages Router

import "@/styles/globals.css";
import type { AppProps } from "next/app";
import { GSReporter } from "gs-error-reporter";                                  // import GSReporter into layout.tsx

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <GSReporter />                                                             // Initialize GSReporter 
      <Component {...pageProps} />;
    </>
  )
}

4. Done 🎉

Throw an error.

Receive an email.


Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | GS_REPORTER_EMAIL | ✅ | Gmail account used to send reports | | GS_REPORTER_APP_PASSWORD | ✅ | Gmail App Password | | GS_REPORTER_RECEIVER | ✅ | Email that receives reports | | BASE_URL | ✅ | Project URL | | PROJECT_NAME | ✅ | Project name displayed in reports |


Email Report

Every report contains:

Project

  • Project Name

Error

  • Runtime
  • Error Message
  • Environment
  • Timestamp

Request

  • URL
  • Method

System

  • User Agent
  • Browser
  • Platform
  • Node Version
  • Language

Debugging

  • Stack Trace
  • Additional Data

Include screenshot here.


How It Works

Application

        │

        ▼

 GSReporter

        │

        ▼

 API Route

        │

        ▼

 Nodemailer

        │

        ▼

 Gmail SMTP

        │

        ▼

 Your Inbox

CLI

CLI makes the installation too easy for anyone.

  • Project Detection

    The CLI automatically detects the type of Next.js project you're using (App Router, Pages Router, or Hybrid)
  • Generate Files

    The CLI can generate important files for the error monitoring system to work properly.

Generated Files

App router

app/api/gs-error-reporter/route.ts/js     (TypeScript / JavaScript)

instrumentation.ts/js                     (TypeScript / JavaScript)

.env

The app/api/gs-error-reporter/route.ts file sends the email to the SMTP server (Email service) you are using. instrumentation.ts file is used to initialize the server error monitoring The .env file is used to store environment variables necessary for the error monitoring and your own project.

Pages Router

pages/api/gs-error-reporter.ts/js         (TypeScript / JavaScript)

instrumentation.ts/js                     (TypeScript / JavaScript)

.env

The pages/api/gs-error-reporter.ts file sends the email to the SMTP server (Email service) you are using. instrumentation.ts file is used to initialize the server error monitoring The .env file is used to store environment variables necessary for the error monitoring and your own project.


Configuration

Once the CLI created all the files, next you just impliment into you layout.ts/_app.ts [App Router / Pages Router]


Supported Environments

| Platform | Supported | |-----------|-----------| | Next.js 13 | ✅ | | Next.js 14 | ✅ | | Next.js 15 | ✅ | | App Router | ✅ | | Pages Router | ✅ | | Node Runtime | ✅ | | Edge Runtime | ❌ |


Performance

  • No database
  • No background workers
  • Lightweight
  • Lightning fast
  • Minimal runtime overhead

Security

  • SMTP credentials never leave your server.
  • No third-party monitoring service.
  • Emails are sent directly through your configured SMTP server.

Current Limitations

  • Gmail SMTP only
  • Node runtime only
  • No dashboard
  • No analytics

Roadmap

Current

  • Email reporting
  • CLI
  • App Router support
  • Pages Router support

Planned

  • Multiple SMTP providers
  • Multiple frameworks
  • Custom templates
  • Attachments
  • Web dashboard
  • Better CLI

Troubleshooting

Email not sending

Possible causes:

  • Wrong App Password
  • Invalid receiver email
  • SMTP blocked
  • BASE_URL incorrect

License

MIT License


Support

If you find a bug:

  • Open an issue
  • Start a discussion
  • Submit a pull request

Acknowledgements

Thank everyone who contributed to the project.