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

create-sentry-vercel-logger

v1.0.1

Published

Quickly set up Sentry + Vercel logging with GitHub integration for Next.js projects

Downloads

21

Readme

Create Sentry Vercel Logger

Quickly set up Sentry + Vercel logging with GitHub integration for Next.js projects.

Usage

npx create-sentry-vercel-logger
# or
npm create sentry-vercel-logger@latest

What it does

This package automatically configures your Next.js application with:

  • Sentry Integration: Complete error tracking setup for client, server, and edge runtimes
  • Universal Logger: Centralized logging utility that works across your entire application
  • Error Boundaries: Global error handling with custom error pages
  • GitHub Actions: Automated Vercel log monitoring workflow
  • Environment Setup: Proper .env file configuration with security best practices

Features

🚨 Error Tracking

  • Client-side error capture with session replay
  • Server-side error logging for API routes
  • Edge runtime error handling
  • Performance monitoring integration

📝 Universal Logging

  • Structured logging with context
  • Automatic breadcrumb creation
  • API request/response logging
  • Performance transaction tracking

🔧 Easy Setup

  • Interactive CLI wizard
  • Automatic dependency installation
  • Configuration file generation
  • Environment variable setup

⚙️ GitHub Integration

  • Automated Vercel log monitoring
  • Error alerting workflows
  • Performance metrics tracking

Prerequisites

  • Next.js project (App Router or Pages Router)
  • Sentry account and project
  • Node.js 14+

Configuration Options

During setup, you'll be prompted for:

  • Sentry DSN: Your Sentry project's Data Source Name
  • Vercel Credentials: API token and project ID (optional)
  • Features: Select which components to install
  • GitHub Actions: Choose whether to set up automated monitoring

File Structure

After installation, your project will include:

your-nextjs-project/
├── sentry.client.config.ts    # Client-side Sentry config
├── sentry.server.config.ts    # Server-side Sentry config
├── instrumentation.ts         # Next.js instrumentation
├── next.config.js            # Updated with Sentry integration
├── app/
│   └── error.tsx             # Global error boundary
├── lib/
│   └── logger.ts             # Universal logging utility
├── .github/workflows/
│   └── vercel-logs-monitor.yml
├── .env.local                # Environment variables
└── .env.example              # Environment template

Environment Variables

The following environment variables will be configured:

# Required
NEXT_PUBLIC_SENTRY_DSN=your_sentry_dsn

# Optional (for GitHub Actions)
VERCEL_TOKEN=your_vercel_token
VERCEL_PROJECT_ID=your_project_id

Usage Examples

Using the Logger

import { logger } from '@/lib/logger';

// Basic logging
logger.info('User logged in', { userId: '123' });
logger.warn('API rate limit approaching', { remaining: 5 });
logger.error('Database connection failed', error);

// API route logging
export async function POST(request: Request) {
  try {
    // Your API logic
  } catch (error) {
    logger.apiError(request, error, { additional: 'context' });
    return NextResponse.json({ error: 'Internal error' }, { status: 500 });
  }
}

// Performance tracking
const transaction = logger.startTransaction('checkout-process', 'navigation');
// ... your code
transaction.finish();

Manual Sentry Usage

import * as Sentry from '@sentry/nextjs';

// Capture custom events
Sentry.captureMessage('Custom event occurred');

// Add user context
Sentry.setUser({ id: '123', email: '[email protected]' });

// Add custom tags
Sentry.setTag('feature', 'checkout');

Development

To test this package locally:

  1. Clone the repository
  2. Run npm install
  3. Create a test Next.js project
  4. Run node /path/to/create-sentry-vercel-logger/index.js from your test project

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with a real Next.js project
  5. Submit a pull request

License

MIT

Support