Open Source

Your code is haunted
ghostbug catches the bugs you never see coming

Silently captures errors, network failures, console logs, performance bottlenecks, and memory leaks. Zero config. Zero dependencies. It just watches.

$ npm install ghostbug
👻 ghostbug
Copy MD Export
×
error
TypeError: Cannot read property 'nested' of undefined
14:32:07 · /dashboard
network
GET /api/users → 500
14:32:12 · /dashboard
error
Unhandled promise rejection: Network timeout
14:33:01 · /settings

Silent watchers.
Complete context.

Eight collectors haunt your app in the background. When something breaks, you already have everything.

👻
Error Tracking
Auto-captures uncaught exceptions, promise rejections, and stack traces with source locations.
🕸️
Network Monitoring
Intercepts fetch and XHR failures. Captures method, URL, status, and timing for every failed request.
📜
Console Capture
Records console.error and console.warn calls as structured events with full argument capture.
Performance Metrics
Tracks Long Tasks, FCP, LCP, and layout shifts using PerformanceObserver. Flags bottlenecks automatically.
🧠
Memory Monitoring
Samples heap usage every 10s. Triggers reports on high usage (>90%) or rapid growth (>50%).
👁️
Click & Interaction Trail
Records last 20 clicks with selectors and tracks form input, scrolling, and resize events as breadcrumbs.
8 collectors. Zero config. Try it now.
$ npm install ghostbug
View on npm

Two lines. That's it.

Drop it in, summon it. ghostbug silently wires every collector and conjures a floating widget.

app.ts
import ghostbug from 'ghostbug';

// Summon the ghost — everything is wired up
ghostbug.init({
  widget: { position: 'bottom-right' },
  collectors: {
    errors:      true,
    console:     true,
    network:     true,
    clicks:      true,
    performance: true,
    memory:      true,
  },
});

// Attach user context to every haunting
ghostbug.setUser({ id: 'user-42', plan: 'pro' });

// Listen for ghosts in real-time
ghostbug.onBug((report) => {
  console.log('Bug caught:', report.type, report.payload);
});

// Exorcise when you need it
ghostbug.download();        // JSON file
ghostbug.toMarkdown();      // Paste into GitHub issue
Live Demo

Watch the ghost in action.

A bug occurs. ghostbug catches it — with full context, breadcrumb trail, and zero config. All in real-time.

localhost:3000/dashboard
Dashboard Settings Profile

Welcome back, User #42

Loading user data from API...

Fetch User Data
👻 ghostbug
0
👻
👻
Waiting for bugs...
Impressed? Add it in seconds.
$ npm install ghostbug
View on npm

The haunting in four steps.

ghostbug silently watches, captures, deduplicates, and serves — all without you lifting a finger.

👻
Summon
Call init() and the ghost awakens
👀
Watch
Collectors silently monitor errors, network, console, clicks
💠
Capture
Deduplicates, rate-limits, and builds rich context reports
📤
Export
JSON download, Markdown for GitHub, or real-time callbacks

Lightweight. Tested. Spectral.

0
Dependencies
~7KB
Gzipped
81+
Tests Passing
3x
Build Formats (ESM, CJS, IIFE)

You don't need a platform.
You need context.

Every other tool wants you to sign up, pay, and send your data to their servers. ghostbug keeps everything local.

ghostbug Sentry LogRocket Bugsnag TrackJS
Setup ghostbug.init() Account + DSN + config Account + SDK + config Account + API key Account + token
Server required ✕ No Yes (SaaS) Yes (SaaS) Yes (SaaS) Yes (SaaS)
Bundle size ~7KB gz ~70KB+ ~100KB+ ~30KB+ ~10KB
Dependencies 0 Many Many Several Few
Data stays local ✓ Yes Sent to Sentry Sent to LogRocket Sent to Bugsnag Sent to TrackJS
Pricing Free forever Free tier / Paid Paid Paid Paid
Built-in widget ✓ Yes Dashboard only Dashboard only Dashboard only Dashboard only
Export to GitHub/Jira Markdown + JSON Integration required Integration required Integration required

Summon in 60 seconds.

Works with any framework — React, Next.js, Vue, Svelte, or plain HTML.

1
Install the package
npm install ghostbug
2
Summon in your app entry
import ghostbug from 'ghostbug'; ghostbug.init({ widget: true });
3
Or use a script tag (no bundler needed)
<script src="https://unpkg.com/ghostbug"></script> <script>ghostbug.init({ widget: true });</script>

Stop flying blind.
Let the ghost watch.

Add ghostbug to your project in seconds. Your future self will thank you.

npm install ghostbug Star on GitHub