SDKs JavaScript SDK Python SDK Go SDK Ruby SDK How It Works Features Pricing FAQ Blog
Log In Start Free Trial

JavaScript SDK

Capture production errors automatically in your Express and Next.js applications.

Installation

$ npm install @bugstack/sdk

Quick Start: Express

javascript
const express = require('express');
const { initBugStack } = require('@bugstack/sdk');

const app = express();

// Initialize bugstack
initBugStack({ apiKey: process.env.BUGSTACK_API_KEY });

app.get('/', (req, res) => {
  res.send('Hello World');
});

// bugstack automatically captures unhandled errors
app.listen(3000);

Quick Start: Next.js

typescript
// app/layout.tsx
import { initBugStack } from '@bugstack/sdk';

// Initialize bugstack once at the app root
initBugStack({ apiKey: process.env.BUGSTACK_API_KEY! });

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

Source Code

View the full source code, report issues, and contribute on GitHub.

← Back to Documentation