{"id":17572373,"url":"https://github.com/codex-team/hawk.php","last_synced_at":"2025-04-28T16:15:10.323Z","repository":{"id":21747125,"uuid":"93923262","full_name":"codex-team/hawk.php","owner":"codex-team","description":"PHP Errors catching and monitoring","archived":false,"fork":false,"pushed_at":"2024-12-05T14:38:51.000Z","size":402,"stargazers_count":20,"open_issues_count":4,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-15T22:04:11.007Z","etag":null,"topics":["catcher","composer","enabling-handlers","error-catcher","hawk","php"],"latest_commit_sha":null,"homepage":"https://hawk.so","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codex-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2017-06-10T07:29:53.000Z","updated_at":"2024-12-05T14:38:43.000Z","dependencies_parsed_at":"2023-02-13T03:01:48.792Z","dependency_job_id":null,"html_url":"https://github.com/codex-team/hawk.php","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fhawk.php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/hawk.php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342726,"owners_count":21574245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["catcher","composer","enabling-handlers","error-catcher","hawk","php"],"created_at":"2024-10-21T19:04:09.251Z","updated_at":"2025-04-28T16:15:10.306Z","avatar_url":"https://github.com/codex-team.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hawk PHP\n\nPHP errors Catcher for [Hawk.so](https://hawk.so).\n\n![](./images/4c6e5fee-da7e-4bc5-a898-f19d12acb005.jpg)\n\n## Setup\n\n1. [Register](https://garage.hawk.so/sign-up) an account, create a Project and get an Integration Token.\n\n2. Install SDK via [composer](https://getcomposer.org) to install the Catcher\n\nCatcher provides support for PHP 7.2 or later\n\n```bash\n$ composer require codex-team/hawk.php\n```\n\n### Configuration\n\n```php\n\\Hawk\\Catcher::init([\n    'integrationToken' =\u003e 'your integration token'\n]);\n```\n\nAfter initialization you can set `user` or `context` for any event that will be send to Hawk\n\n```php\n\\Hawk\\Catcher::get()\n    -\u003esetUser([\n        'name' =\u003e 'user name',\n        'photo' =\u003e 'user photo',\n    ])\n    -\u003esetContext([\n        ...\n    ]);\n```\n\n\n### Send events and exceptions manually\n\nUse `sendException` method to send any caught exception\n\n```php\ntry {\n    throw new Exception(\"Error Processing Request\", 1);\n} catch (Exception $e) {\n    \\Hawk\\Catcher::get()-\u003esendException($e);\n}\n```\n\nUse `sendEvent` method to send any data (logs, notices or something else)\n\n```php\n\\Hawk\\Catcher::get()-\u003esendMessage('your message', [\n    ... // Context\n]);\n```\n\n### Filtering sensitive information\n\nUse the `beforeSend` hook to filter any data you don't want to send to Hawk. Use setters to clear any property.\n\n```php\n\\Hawk\\Catcher::init([\n    // ...\n    'beforeSend' =\u003e function (\\Hawk\\EventPayload $eventPayload) {\n        $user = $eventPayload-\u003egetUser();\n        \n        if (!empty($user['email'])){\n            unset($user['email']);\n        \n            $eventPayload-\u003esetUser($user);\n        }\n\n        return $eventPayload;\n    }\n]);\n```\n\n## Issues and improvements\n\nFeel free to ask questions or improve the project.\n\n## Links\n\nRepository: https://github.com/codex-team/hawk.php\n\nReport a bug: https://github.com/codex-team/hawk.php/issues\n\nComposer Package: https://packagist.org/packages/codex-team/hawk.php\n\nCodeX Team: https://codex.so\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fhawk.php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Fhawk.php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fhawk.php/lists"}