PHPackages                             bughq/bughq - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bughq/bughq

ActiveLibrary

bughq/bughq
===========

bughq error tracking - PHP SDK

v0.1.2(1mo ago)12101MITPHPPHP &gt;=8.4CI passing

Since Jul 14Pushed 1mo agoCompare

[ Source](https://github.com/bughq/bughq-php)[ Packagist](https://packagist.org/packages/bughq/bughq)[ Docs](https://bughq.org)[ RSS](/packages/bughq-bughq/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (4)Used By (1)

bughq PHP SDK
=============

[](#bughq-php-sdk)

Privacy-first error tracking for PHP. Captures exceptions, PHP errors, and fatal shutdowns, enriches them with breadcrumbs, tags, contexts, and user data, and reports them to [bughq](https://bughq.org).

Using Laravel? Install [`bughq/bughq-laravel`](https://github.com/bughq/bughq-laravel)instead - it wires everything below into the framework automatically.

Install
-------

[](#install)

Requires PHP 8.4+.

```
composer require bughq/bughq
```

Quick start
-----------

[](#quick-start)

```
use BugHQ\BugHQ;

BugHQ::init([
    'project' => 'acme-api',        // from your bughq dashboard
    'key' => 'pk_...',              // public ingest key (safe to ship)
    // or: 'dsn' => 'https://pk_...@bughq.org/acme-api',
    'release' => '1.4.2',
    'environment' => 'production',
]);
```

That's it - uncaught exceptions, PHP errors, and fatal shutdown errors are reported automatically (set `'captureUnhandled' => false` to opt out).

Manual capture
--------------

[](#manual-capture)

```
try {
    $charger->charge($order);
} catch (PaymentException $e) {
    BugHQ::captureException($e, ['orderId' => $order->id]);
    throw $e;
}

BugHQ::captureMessage('cache rebuild took ' . $secs . 's', 'warning');
```

Context
-------

[](#context)

```
BugHQ::setUser(['id' => $user->id, 'email' => $user->email]);
BugHQ::setTag('plan', 'pro');
BugHQ::setContext('order', ['id' => $order->id, 'total' => $order->total]);
BugHQ::setExtra('attempt', $attempt);
BugHQ::addBreadcrumb([
    'category' => 'payment',
    'message' => 'charge submitted',
    'data' => ['gateway' => 'stripe'],
]);
// force related errors into one issue (or split one apart):
BugHQ::setFingerprint(['checkout', 'gateway-timeout']);
```

Runtime (PHP version, SAPI), server (hostname, OS), and request (method, URL, IP, user agent) contexts are attached automatically.

Options
-------

[](#options)

optiondefault`project`, `key`-or provide `dsn``host``https://bughq.org`self-hosted ingest`release`, `environment`- / `production``sampleRate``1.0`fraction of events to send`dedupeSeconds``5`drop repeats of the same error site`maxBreadcrumbs``30`ring buffer size`ignoreExceptions``[]`class names, `instanceof` match`ignoreMessages``[]`substrings or `/regex/``beforeSend`-`fn (array $payload): ?array` - return `null` to drop`beforeBreadcrumb`-`fn (Breadcrumb $b): ?Breadcrumb``errorTypes``E_ALL`mask for the global error handler`captureUnhandled``true`install global handlers on `init()``timeout` / `connectTimeout``5` / `2`transport (seconds)License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance92

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

38d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86ae8df6a3e7b071e4831eed7228eaa9690c44f19a69751bbb075aad609bbca0?d=identicon)[knightsky123](/maintainers/knightsky123)

---

Top Contributors

[![glennmichael123](https://avatars.githubusercontent.com/u/29087513?v=4)](https://github.com/glennmichael123 "glennmichael123 (10 commits)")

---

Tags

phperror-monitoringcrash-reportingerror-trackingbughq

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bughq-bughq/health.svg)

```
[![Health](https://phpackages.com/badges/bughq-bughq/health.svg)](https://phpackages.com/packages/bughq-bughq)
```

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k262.1M381](/packages/sentry-sentry)[sentry/sdk

This is a meta package of sentry/sentry. We recommend using sentry/sentry directly.

327141.6M178](/packages/sentry-sdk)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1871.6M3](/packages/justbetter-magento2-sentry)[stayallive/wp-sentry

A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry.

390232.3k](/packages/stayallive-wp-sentry)[inspector-apm/inspector-symfony

Code Execution Monitoring for Symfony applications.

2845.3k11](/packages/inspector-apm-inspector-symfony)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
