PHPackages                             codex-team/hawk.php - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. codex-team/hawk.php

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

codex-team/hawk.php
===================

PHP errors Catcher module for Hawk.so

2.2.10(7mo ago)2230.1k↓32.4%4[1 issues](https://github.com/codex-team/hawk.php/issues)[2 PRs](https://github.com/codex-team/hawk.php/pulls)2MITPHPPHP ^7.2 || ^8.0

Since Sep 28Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/codex-team/hawk.php)[ Packagist](https://packagist.org/packages/codex-team/hawk.php)[ RSS](/packages/codex-team-hawkphp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (31)Used By (2)

Hawk PHP
========

[](#hawk-php)

PHP errors Catcher for [Hawk.so](https://hawk.so).

[![](./images/4c6e5fee-da7e-4bc5-a898-f19d12acb005.jpg)](./images/4c6e5fee-da7e-4bc5-a898-f19d12acb005.jpg)

Setup
-----

[](#setup)

1. [Register](https://garage.hawk.so/sign-up) an account, create a Project and get an Integration Token.
2. Install SDK via [composer](https://getcomposer.org) to install the Catcher

Catcher provides support for PHP 7.2 or later

```
$ composer require codex-team/hawk.php
```

### Configuration

[](#configuration)

```
\Hawk\Catcher::init([
    'integrationToken' => 'your integration token'
]);
```

After initialization you can set `user` or `context` for any event that will be send to Hawk

```
\Hawk\Catcher::get()
    ->setUser([
        'name' => 'user name',
        'photo' => 'user photo',
    ])
    ->setContext([
        ...
    ]);
```

### Send events and exceptions manually

[](#send-events-and-exceptions-manually)

Use `sendException` method to send any caught exception

```
try {
    throw new Exception("Error Processing Request", 1);
} catch (Exception $e) {
    \Hawk\Catcher::get()->sendException($e);
}
```

Use `sendEvent` method to send any data (logs, notices or something else)

```
\Hawk\Catcher::get()->sendMessage('your message', [
    ... // Context
]);
```

### Filtering sensitive information

[](#filtering-sensitive-information)

Use the `beforeSend` hook to filter any data you don't want to send to Hawk. Use setters to clear any property.

```
\Hawk\Catcher::init([
    // ...
    'beforeSend' => function (\Hawk\EventPayload $eventPayload) {
        $user = $eventPayload->getUser();

        if (!empty($user['email'])){
            unset($user['email']);

            $eventPayload->setUser($user);
        }

        return $eventPayload;
    }
]);
```

Issues and improvements
-----------------------

[](#issues-and-improvements)

Feel free to ask questions or improve the project.

Links
-----

[](#links)

Repository:

Report a bug:

Composer Package:

CodeX Team:

License
-------

[](#license)

This project is licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)**. See the [LICENSE](./LICENSE) file for the full text.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance72

Regular maintenance activity

Popularity38

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~108 days

Recently: every ~77 days

Total

28

Last Release

221d ago

Major Versions

v1.2.1 → 2.0.02021-04-05

PHP version history (5 changes)1.0PHP &gt;=5.6

v1.1PHP &gt;=5.3

2.0.0PHP ^7.1

2.1.6PHP ^7.2

2.2.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/09eced8d4fa0c7717b174485043d7dcbd020f713c1decdab69a69fd0ca3d1eb3?d=identicon)[codex-team](/maintainers/codex-team)

---

Top Contributors

[![khaydarov](https://avatars.githubusercontent.com/u/6507765?v=4)](https://github.com/khaydarov "khaydarov (101 commits)")[![talyguryn](https://avatars.githubusercontent.com/u/15259299?v=4)](https://github.com/talyguryn "talyguryn (78 commits)")[![pavelzotikov](https://avatars.githubusercontent.com/u/1876929?v=4)](https://github.com/pavelzotikov "pavelzotikov (43 commits)")[![n0str](https://avatars.githubusercontent.com/u/988885?v=4)](https://github.com/n0str "n0str (13 commits)")[![ilyatos](https://avatars.githubusercontent.com/u/25087524?v=4)](https://github.com/ilyatos "ilyatos (9 commits)")[![neSpecc](https://avatars.githubusercontent.com/u/3684889?v=4)](https://github.com/neSpecc "neSpecc (6 commits)")[![demyashev](https://avatars.githubusercontent.com/u/4449309?v=4)](https://github.com/demyashev "demyashev (3 commits)")[![Dobrunia](https://avatars.githubusercontent.com/u/48620984?v=4)](https://github.com/Dobrunia "Dobrunia (2 commits)")[![nikmel2803](https://avatars.githubusercontent.com/u/32655339?v=4)](https://github.com/nikmel2803 "nikmel2803 (1 commits)")

---

Tags

catchercomposerenabling-handlerserror-catcherhawkphpphperrorhawkcatcher

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/codex-team-hawkphp/health.svg)

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

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[e2ex/e2ex

Converts PHP Errors to Exceptions and (optionally) logs PHP Errors, Notices and Warnings with a PSR-3 compatible logger

101.5k](/packages/e2ex-e2ex)

PHPackages © 2026

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