{"id":20180794,"url":"https://github.com/frain-dev/convoy-php","last_synced_at":"2025-04-10T05:08:46.920Z","repository":{"id":62506911,"uuid":"465930978","full_name":"frain-dev/convoy-php","owner":"frain-dev","description":"Convoy SDK for PHP","archived":false,"fork":false,"pushed_at":"2023-03-16T15:40:15.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T05:08:41.639Z","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/frain-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2022-03-04T00:38:12.000Z","updated_at":"2023-07-10T05:40:23.000Z","dependencies_parsed_at":"2024-11-14T07:03:25.795Z","dependency_job_id":null,"html_url":"https://github.com/frain-dev/convoy-php","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":0.09090909090909094,"last_synced_commit":"ba9efeb8f1335a18b3075b59ebe21d864f201bdc"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frain-dev%2Fconvoy-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frain-dev%2Fconvoy-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frain-dev%2Fconvoy-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frain-dev%2Fconvoy-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frain-dev","download_url":"https://codeload.github.com/frain-dev/convoy-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161270,"owners_count":21057555,"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-14T02:32:58.692Z","updated_at":"2025-04-10T05:08:46.888Z","avatar_url":"https://github.com/frain-dev.png","language":"PHP","readme":"# Convoy SDK for PHP\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/frain/convoy.svg?style=flat-square)](https://packagist.org/packages/frain/convoy)\n[![Total Downloads](https://img.shields.io/packagist/dt/frain/convoy.svg?style=flat-square)](https://packagist.org/packages/frain/convoy)\n\nThis is the Convoy PHP SDK. This SDK contains methods for easily interacting with Convoy's API. Below are examples to get you started. For additional examples, please see our official documentation at (https://convoy.readme.io/reference)\n\n\n## Installation\nTo install the package, you will need to be using Composer in your project. \n\nThe Convoy PHP SDK is not hard coupled to any HTTP Client such as Guzzle or any other library used to make HTTP requests. The HTTP Client implementation is based on [PSR-18](https://www.php-fig.org/psr/psr-18/). This provides you with the convenience of choosing what [PSR-7](https://packagist.org/providers/psr/http-message-implementation) and [HTTP Client](https://packagist.org/providers/psr/http-client-implementation) you want to use.\n\nTo get started quickly, \n\n```bash\ncomposer require frain/convoy symfony/http-client nyholm/psr7\n```\n\n### Setup Client\n\nNext, import the `convoy` module and setup with your auth credentials.\n\n```php\nuse Convoy\\Convoy;\n\n$convoy = new Convoy([\"api_key\" =\u003e \"your_api_key\", \"project_id\" =\u003e \"your_project_id\"]);\n```\n\n### Create an Endpoint\n\nAn endpoint represents a target URL to receive events.\n\n```php\n$endpointData = [\n    \"name\" =\u003e \"Default Endpoint\",\n    \"url\" =\u003e \"https://0d87-102-89-2-172.ngrok.io\",\n    \"description\" =\u003e \"Default Endpoint\",\n    \"secret\" =\u003e \"endpoint-secret\",\n    \"events\" =\u003e [\"*\"]\n];\n\n$response = $convoy-\u003eendpoints()-\u003ecreate($endpointData);\n```\n\n### Update an Endpoint\n\n```php\n$endpointId = \"01GTVFSGBAH8NJTMT5Y1ENE218\";\n\n$endpointData = [\n    \"name\" =\u003e \"Default Endpoint\",\n    \"url\" =\u003e \"https://0d87-102-89-2-172.ngrok.io\",\n    \"description\" =\u003e \"Default Endpoint\",\n    \"secret\" =\u003e \"endpoint-secret\",\n    \"events\" =\u003e [\"*\"]\n];\n\n$response = $convoy-\u003eendpoints()-\u003eupdate($endpointId, $endpointData);\n```\n\n### Sending an Event\n\nTo send an event, you'll need the `uid` from the endpoint we created earlier.\n\n```php\n$eventData = [\n    \"endpoint_id\" =\u003e $endpointId,\n    \"event_type\" =\u003e \"payment.success\",\n    \"data\" =\u003e [\n        \"event\" =\u003e \"payment.success\",\n        \"data\" =\u003e [\n            \"status\" =\u003e \"Completed\",\n            \"description\" =\u003e \"Transaction Successful\",\n            \"userID\" =\u003e \"test_user_id808\"\n        ]\n    ]\n];\n\n$response = $convoy-\u003eevents()-\u003ecreate($eventData);\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Frain](https://github.com/frain-dev)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrain-dev%2Fconvoy-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrain-dev%2Fconvoy-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrain-dev%2Fconvoy-php/lists"}