{"id":16674423,"url":"https://github.com/settermjd/twilio-eventstreams-webhook-validator-slim","last_synced_at":"2026-01-29T16:36:48.765Z","repository":{"id":256310630,"uuid":"854909093","full_name":"settermjd/twilio-eventstreams-webhook-validator-slim","owner":"settermjd","description":"Slim middleware for validating Twilio Event Streams Webhooks","archived":false,"fork":false,"pushed_at":"2024-09-11T00:32:50.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T02:41:00.316Z","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/settermjd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","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},"funding":{"github":"settermjd","buy_me_a_coffee":"settermjd"}},"created_at":"2024-09-10T01:11:27.000Z","updated_at":"2025-07-29T10:31:19.000Z","dependencies_parsed_at":"2024-11-18T22:44:47.252Z","dependency_job_id":"b851da08-af11-4619-a942-5c7eadfd585c","html_url":"https://github.com/settermjd/twilio-eventstreams-webhook-validator-slim","commit_stats":null,"previous_names":["settermjd/twilio-eventstreams-webhook-validator-slim"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/settermjd/twilio-eventstreams-webhook-validator-slim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Ftwilio-eventstreams-webhook-validator-slim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Ftwilio-eventstreams-webhook-validator-slim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Ftwilio-eventstreams-webhook-validator-slim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Ftwilio-eventstreams-webhook-validator-slim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/settermjd","download_url":"https://codeload.github.com/settermjd/twilio-eventstreams-webhook-validator-slim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/settermjd%2Ftwilio-eventstreams-webhook-validator-slim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28880980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-10-12T12:43:10.365Z","updated_at":"2026-01-29T16:36:48.749Z","avatar_url":"https://github.com/settermjd.png","language":"PHP","funding_links":["https://github.com/sponsors/settermjd","https://buymeacoffee.com/settermjd"],"categories":[],"sub_categories":[],"readme":"# Slim v4 Twilio Event Streams Webhook Validator Middleware\n\n![testing workflow](https://github.com/settermjd/twilio-eventstreams-webhook-validator-slim/actions/workflows/php.yml/badge.svg)\n\nThis is a small piece of middleware for [the Slim Framework (v4)][slim_url] that validates a [Twilio Event Streams Webhook][twilio_event_streams_webhook_url].\n\n## How Does It Work?\n\nAfter adding the middleware to one or more of your application's routes, when a route is dispatched, the webhook is validated.\nIf the webhook _is_ valid, the next request is called. \nOtherwise, an [HTTP 400 Bad Request][http_400_bad_request_url] is returned, along with a [problem details][problem_details_rfc_url] response, formatted as JSON or XML based on the request's [Accept header][accept_header_url].\n\n## Why Use It?\n\nYou could code up the functionality yourself; and [check out the tutorial on the Twilio blog][twilio_blog_url] if you'd like to.\nBut, this middleware avoids the need to do so.\nInstead, just initialise it and add it to the relevant routes, then focus on the remaining functionality of your application.\n\n## Prerequisites\n\nTo use this middleware, you're going to need a Twilio account (either free or paid). \nIf you are new to Twilio, [create a free account][twilio_referral_url].\n\n## ⚡️ Quick Start\n\nTo use the middleware in your Slim (v4) application, first add the project as a dependency by running the following command:\n\n```bash \ncomposer require settermjd/twilio-eventstreams-webhook-validator-slim\n```\n\nThen, in the appropriate part of your application, initialise a new `EventStreams\\EventStreamsWebhookValidatorMiddleware` object, which requires three parameters:\n\n- The application's public URI. During development you could use [ngrok][ngrok_url] to expose the application to the public internet and generate the public URI.\n- The webhook URI's path\n- A `\\Twilio\\Security\\RequestValidator` object, initialised with your [Twilio Auth Token][twilio_auth_token_url]\n\n**Note:** The first two parameters to `EventStreamsWebhookValidatorMiddleware` ensure that the app's correct public URI is used as part of the webhook validation process.\n\nThen, follow [the Slim Middleware documentation][slim_middleware_docs_url] to add the middleware to the respective route.\nBelow, you can find examples of adding it as [Route Middleware][slim_docs_route_middleware_url]:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nrequire_once('vendor/autoload.php');\n\nuse EventStreams\\EventStreamsWebhookValidatorMiddleware;\nuse Twilio\\Security\\RequestValidator;\n\n$app = new \\Slim\\App();\n\n$eventStreamsWebhookValidatorMiddleware = new EventStreamsWebhookValidatorMiddleware(\n    \"\u003c\u003cTHE APP'S PUBLIC URL\u003e\u003e\",\n    \"\u003c\u003cTHE WEBHOOK PATH\u003e\u003e\",\n     new RequestValidator(\"\u003c\u003cYOUR TWILIO AUTH TOKEN\u003e\u003e\")\n);\n\n$app-\u003eget('/', function ($request, $response, $args) {\n    $response-\u003egetBody()-\u003ewrite(' Hello ');\n    return $response;\n})-\u003eadd($eventStreamsWebhookValidatorMiddleware);\n\n$app-\u003erun();\n```\n\nThen, replace `\u003c\u003cTHE APP'S PUBLIC URL\u003e\u003e\"` with the public URI of the application, `\u003c\u003cTHE WEBHOOK PATH\u003e\u003e` with he path of the route that handles the webhook request, and `\u003c\u003cYOUR TWILIO AUTH TOKEN\u003e\u003e` with your Twilio Auth Token.\n\n## Contributing\n\nIf you want to contribute to the project, whether you have found issues with it or just want to improve it, here's how:\n\n- [Issues][issues_url]: ask questions and submit your feature requests, bug reports, etc\n- [Pull requests][pull_requests_url]: send your improvements\n\n## Did You Find The Project Useful?\n\nIf the project was useful and you want to say thank you and/or support its active development, here's how:\n\n- Add a GitHub Star to the project\n- Write an interesting article about the project wherever you blog\n\n[issues_url]: https://github.com/settermjd/twilio-eventstreams-webhook-validator-slim/issues\n[pull_requests_url]: https://github.com/settermjd/twilio-eventstreams-webhook-validator-slim/pulls\n[accept_header_url]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept\n[problem_details_rfc_url]: https://datatracker.ietf.org/doc/html/rfc7807\n[http_400_bad_request_url]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400\n[ngrok_url]: https://ngrok.com/\n[twilio_auth_token_url]: https://help.twilio.com/articles/223136027-Auth-Tokens-and-How-to-Change-Them \n[twilio_referral_url]: https://www.twilio.com/referral/QlBtVJ\n[twilio_event_streams_webhook_url]: https://www.twilio.com/docs/events/webhook-quickstart \n[slim_url]: https://www.slimframework.com/\n[slim_middleware_docs_url]: https://www.slimframework.com/docs/v4/concepts/middleware.html#registering-middleware\n[slim_docs_route_middleware_url]: https://www.slimframework.com/docs/v4/concepts/middleware.html#route-middleware\n[twilio_blog_url]: https://www.twilio.com/en-us/blog/validate-twilio-event-streams-webhooks-php","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsettermjd%2Ftwilio-eventstreams-webhook-validator-slim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsettermjd%2Ftwilio-eventstreams-webhook-validator-slim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsettermjd%2Ftwilio-eventstreams-webhook-validator-slim/lists"}