{"id":49139697,"url":"https://github.com/alby-sh/alby-sdk-php","last_synced_at":"2026-04-26T04:00:46.690Z","repository":{"id":352600891,"uuid":"1215497591","full_name":"alby-sh/alby-sdk-php","owner":"alby-sh","description":"Official Alby error-tracking SDK for PHP 8.2+ and Laravel","archived":false,"fork":false,"pushed_at":"2026-04-20T10:20:24.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T00:38:09.885Z","etag":null,"topics":["alby","error-monitoring","error-tracking","laravel","observability","php","sdk"],"latest_commit_sha":null,"homepage":"https://alby.sh","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/alby-sh.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T01:19:26.000Z","updated_at":"2026-04-20T10:18:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alby-sh/alby-sdk-php","commit_stats":null,"previous_names":["alby-sh/alby-php"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alby-sh/alby-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alby-sh%2Falby-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alby-sh%2Falby-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alby-sh%2Falby-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alby-sh%2Falby-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alby-sh","download_url":"https://codeload.github.com/alby-sh/alby-sdk-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alby-sh%2Falby-sdk-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32161325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["alby","error-monitoring","error-tracking","laravel","observability","php","sdk"],"created_at":"2026-04-22T00:02:55.051Z","updated_at":"2026-04-23T01:00:23.312Z","avatar_url":"https://github.com/alby-sh.png","language":"PHP","readme":"# alby/report\n\n[![Packagist](https://img.shields.io/packagist/v/alby/report.svg?color=4f5d95\u0026logo=packagist\u0026logoColor=white)](https://packagist.org/packages/alby/report)\n[![Packagist downloads](https://img.shields.io/packagist/dt/alby/report.svg?color=4f5d95)](https://packagist.org/packages/alby/report)\n[![PHP](https://img.shields.io/packagist/php-v/alby/report.svg?color=777bb4\u0026logo=php\u0026logoColor=white)](https://packagist.org/packages/alby/report)\n[![CI](https://github.com/alby-sh/alby-sdk-php/actions/workflows/ci.yml/badge.svg)](https://github.com/alby-sh/alby-sdk-php/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\nOfficial [Alby](https://alby.sh) error-tracking SDK for PHP 8.2+.\n\nCaptures uncaught exceptions, errors, and anything you explicitly report, then\nships them to your Alby project where an AI agent can auto-open a fix task.\n\n## Install\n\n```bash\ncomposer require alby/report\n```\n\nRequires PHP 8.2+, `ext-curl`, `ext-json`. No other runtime dependencies.\n\n## Use\n\n```php\nuse Alby\\Report\\Alby;\n\nAlby::init([\n    'dsn'         =\u003e getenv('ALBY_DSN'),  // https://\u003ckey\u003e@alby.sh/ingest/v1/\u003capp-id\u003e\n    'release'     =\u003e '1.4.2',\n    'environment' =\u003e 'production',\n]);\n\n// Uncaught exceptions and fatal errors are sent automatically.\n\n// Manual report:\ntry {\n    doThing();\n} catch (\\Throwable $e) {\n    Alby::captureException($e);\n}\n\n// Non-error events:\nAlby::captureMessage('Failed to acquire lease', 'warning');\n\n// Enrich the scope:\nAlby::setUser(['id' =\u003e 'u_412', 'email' =\u003e 'ada@example.com']);\nAlby::setTag('region', 'eu-west-3');\nAlby::setContext('billing_tenant', ['plan' =\u003e 'pro', 'seats' =\u003e 12]);\nAlby::addBreadcrumb(['type' =\u003e 'http', 'message' =\u003e 'GET /api/orders/42']);\n\n// Before exit (e.g. in a worker):\nAlby::flush(2000);\n```\n\nThe SDK buffers events in memory and ships them on `flush()` or at\n`register_shutdown_function` time. Sending is synchronous with a bounded queue\nof 100 events; long-running workers should call `Alby::flush()` at the end of\neach unit of work.\n\n## Laravel\n\nThe package auto-discovers its service provider, so nothing else is needed on\nLaravel 5.5+. Publish the config:\n\n```bash\nphp artisan vendor:publish --tag=alby-report-config\n```\n\nThen set your DSN in `.env`:\n\n```\nALBY_DSN=https://\u003ckey\u003e@alby.sh/ingest/v1/\u003capp-id\u003e\nALBY_RELEASE=1.4.2\n```\n\n### Reporting exceptions\n\n**Laravel 11+ (`bootstrap/app.php`):**\n\n```php\n-\u003ewithExceptions(function (Exceptions $exceptions) {\n    $exceptions-\u003ereport(fn (\\Throwable $e) =\u003e \\Alby\\Report\\Alby::captureException($e));\n})\n```\n\n**Laravel ≤10 (`app/Exceptions/Handler.php`):**\n\n```php\npublic function register(): void\n{\n    $this-\u003ereportable(fn (\\Throwable $e) =\u003e \\Alby\\Report\\Alby::captureException($e));\n}\n```\n\n### Optional breadcrumbs\n\nIn `config/alby-report.php`:\n\n```php\n'breadcrumbs' =\u003e [\n    'queries' =\u003e true,   // DB query breadcrumbs\n    'routes'  =\u003e true,   // Route-matched breadcrumbs\n],\n```\n\n## Options\n\n| Option           | Type     | Default                 | Notes |\n|------------------|----------|-------------------------|-------|\n| `dsn`            | `string` | — (required)            | From your Alby app settings. |\n| `release`        | `string` | `''`                    | Build version. Enables release tracking / auto-resolve. |\n| `environment`    | `string` | `APP_ENV` / `production`| `production` / `staging` / `dev` / anything. |\n| `sample_rate`    | `float`  | `1.0`                   | Fraction of events actually sent, 0..1. |\n| `server_name`    | `string` | `gethostname()`         | Attached to every event. |\n| `auto_register`  | `bool`   | `true`                  | Install `set_exception_handler` + `set_error_handler` + `register_shutdown_function`. Chains to existing handlers. |\n| `debug`          | `bool`   | `false`                 | SDK diagnostics to stderr. |\n| `transport`      | `Transport` | `CurlTransport`      | Injectable transport (tests, alt delivery). |\n| `breadcrumbs_max`| `int`    | `100`                   | Ring-buffer cap. |\n\n## Wire protocol\n\nThis SDK speaks the [Alby Ingest Protocol v1](./PROTOCOL_V1.md). If you're\nwriting an SDK for a new runtime, start there.\n\n## Links\n\n- Website: [alby.sh](https://alby.sh)\n- Report issues: [GitHub Issues](https://github.com/alby-sh/alby-sdk-php/issues)\n- Other SDKs: [alby-sdk-js](https://github.com/alby-sh/alby-sdk-js) · [alby-sdk-browser](https://github.com/alby-sh/alby-sdk-browser) · [alby-sdk-python](https://github.com/alby-sh/alby-sdk-python)\n\n## License\n\nMIT — © Alby.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falby-sh%2Falby-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falby-sh%2Falby-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falby-sh%2Falby-sdk-php/lists"}