{"id":21894760,"url":"https://github.com/zumba/deadmanssnitch-php-sdk","last_synced_at":"2025-04-15T16:01:53.165Z","repository":{"id":37588066,"uuid":"78047195","full_name":"zumba/deadmanssnitch-php-sdk","owner":"zumba","description":"Deadmanssnitch API SDK for PHP","archived":false,"fork":false,"pushed_at":"2023-04-19T20:41:07.000Z","size":146,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T22:11:16.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zumba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2017-01-04T19:42:58.000Z","updated_at":"2022-04-12T15:43:33.000Z","dependencies_parsed_at":"2024-11-28T16:16:32.691Z","dependency_job_id":null,"html_url":"https://github.com/zumba/deadmanssnitch-php-sdk","commit_stats":{"total_commits":25,"total_committers":4,"mean_commits":6.25,"dds":0.36,"last_synced_commit":"60c78bd426227e49a895f5d2153f5a4098711fb3"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fdeadmanssnitch-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fdeadmanssnitch-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fdeadmanssnitch-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zumba%2Fdeadmanssnitch-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zumba","download_url":"https://codeload.github.com/zumba/deadmanssnitch-php-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249105473,"owners_count":21213534,"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":[],"created_at":"2024-11-28T13:28:01.080Z","updated_at":"2025-04-15T16:01:53.125Z","avatar_url":"https://github.com/zumba.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deadmansnitch API PHP SDK\n\nThis library allows for easy access to [Deadmanssnitch](https://deadmanssnitch.com/)'s API.\n\nYou can use it to manage snitches through the API or to notify a snitch when a process completes.\n\n## Example Notifier use\n\n```php\n\u003c?php\n\nuse Zumba\\Deadmanssnitch\\Notifier;\n\n$notifier = new Notifier();\n$notifier-\u003epingSnitch('snitch id', 'just checking in.');\n```\n\n## Example API Use\n\n```php\n\u003c?php\n\nuse Zumba\\Deadmanssnitch\\Client;\nuse Zumba\\Deadmanssnitch\\Snitch;\nuse Zumba\\Deadmanssnitch\\Interval;\nuse Zumba\\Deadmanssnitch\\ResponseError;\n\n$client = new Client('your api key here');\n\n// creating a snitch\n$snitch = new Snitch('My cool process', new Interval(Interval::I_DAILY), [\n    'tags' =\u003e ['production', 'critical']\n]);\ntry {\n    $client-\u003ecreateSnitch($snitch);\n} catch (ResponseError $e) {\n    // Failed to create the snitch\n    echo $e-\u003egetMessage();\n}\n\necho $snitch;\n// 12312412\n```\n\n## Installation\n\n```bash\ncomposer require zumba/deadmanssnitch-sdk\n```\n\n## Supported APIs\n\nSupports pinging the `nosnch.in` domain for a specific snitch. See `Notifier::pingSnitch(string $token, string $message = ''): void`.\n\nThe SDK currently supports `v1` of DMS's API.\n\n* [Creating a snitch](https://deadmanssnitch.com/docs/api/v1#creating-a-snitch) - `Client::createSnitch(Snitch $snitch): void`\n* [Listing snitches](https://deadmanssnitch.com/docs/api/v1#listing-your-snitches) - `Client::listSnitches(array $tags = []): []Snitch`\n  * Includes ability to filter by tags\n* [Examining snitches](https://deadmanssnitch.com/docs/api/v1#examining-a-snitch) - `Client::examineSnitch(string $token): Snitch`\n* [Editing a snitch](https://deadmanssnitch.com/docs/api/v1#editing-a-snitch) - `Client::editSnitch(Snitch $snitch): void`\n  * Also supports appending tags and removing a single tag (per the API).\n  * Setting tags on a snitch and using edit will replace the tags with what is provided.\n* [Pausing a snitch](https://deadmanssnitch.com/docs/api/v1#pausing-a-snitch) - `Client::pauseSnitch(string $token): void`\n* [Deleting a snitch](https://deadmanssnitch.com/docs/api/v1#deleting-a-snitch) - `Client::removeSnitch(string $token): void`\n\nNote, we will not support attaining an API key with username/password.\n\n## Advanced usage\n\nYou can provide your own http client and logger to use provided they satisfy the\n`GuzzleHttp\\ClientInterface` and `Psr\\Log\\LoggerInterface` respectively:\n\n```php\n\u003c?php\n\nuse Zumba\\Deadmanssnitch\\Client;\nuse GuzzleHttp\\Client as GuzzleClient;\nuse Monolog\\Logger;\nuse Monolog\\Handler\\StreamHandler;\n\n$http = new GuzzleClient([\n    'base_uri' =\u003e Client::HOST,\n    'auth' =\u003e ['my api key', '']\n]);\n\n$logger = new Logger('name');\n$logger-\u003epushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));\n\n$client = new Client('my api key', $http, $logger);\n```\n\nHowever, please note that guzzle clients are immutable, so you will be responsible\nfor setting the base URI and auth parameters. Internally, `http_errors` is disabled\nin order to wrap and use our own exceptions. If you do not disable this, you will\nneed to catch Guzzle exceptions instead of `Zumba\\Deadmanssnitch\\ResponseError`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzumba%2Fdeadmanssnitch-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzumba%2Fdeadmanssnitch-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzumba%2Fdeadmanssnitch-php-sdk/lists"}