PHPackages                             craigh/alexa-request-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. craigh/alexa-request-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

craigh/alexa-request-validator
==============================

Validates requests from Amazon Alexa

1.0.4(6y ago)511.9k↓50%2[1 issues](https://github.com/craigh411/alexa-request-validator/issues)MITPHP

Since Sep 25Pushed 6y ago2 watchersCompare

[ Source](https://github.com/craigh411/alexa-request-validator)[ Packagist](https://packagist.org/packages/craigh/alexa-request-validator)[ RSS](/packages/craigh-alexa-request-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (5)Used By (0)

alexa-request-validator
=======================

[](#alexa-request-validator)

A PHP implementation of the Alexa request validation required when using a web service with your Alexa skill, as set out in the [Alexa docs](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-an-alexa-skill-as-a-web-service)

Installation
------------

[](#installation)

Install via composer by doing:

`composer require craigh/alexa-request-validator`

### How to use

[](#how-to-use)

Once installed you can instantiate the AlexaRequestValidator in your classes as follows:

```
$validator = new \Humps\AlexaRequest\AlexaRequestValidator('YOUR_ALEXA_SKILL_ID', file_get_contents('php://input'), $_SERVER['HTTP_SIGNATURECERTCHAINURL'], $_SERVER['HTTP_SIGNATURE']);
```

Then simply do (Ideally you would add this in Middleware):

```
try {
  if($validator->validateRequest()){
    // Accept request to your service
  }

  // Reject request with a 500 error, hopefully this shouldn't happen!
}catch(\Humps\AlexaRequest\Exceptions\AlexaValidationException $e) {
  // Reject the request with a 400 error or the given error code (via $e->getCode()) with the returned message ($e->getMessage())
}
```

### Timeout Tolerance

[](#timeout-tolerance)

By default the timeout tolerance is 120 seconds (well within the 150 seconds required by Amazon). If you want to adjust this you can pass a fifth paramater to the constructor:

```
$validator = new AlexaRequestValidator('YOUR_ALEXA_SKILL_ID', file_get_contents('php://input'), $_SERVER['HTTP_SIGNATURECERTCHAINURL'], $_SERVER['HTTP_SIGNATURE'], 150);
```

> **Tip:** If you are testing through the Amazon Alexa Skill "test" section you may want to increase this tolerance during development so you can replay the request through your server. Just don't forget to reset it before certification!

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~226 days

Total

4

Last Release

2478d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/791b31f6b625d43874f70831846b002b7bb46dc911e38b02250e7aaab6596716?d=identicon)[craigh411](/maintainers/craigh411)

---

Top Contributors

[![craigh411](https://avatars.githubusercontent.com/u/13747552?v=4)](https://github.com/craigh411 "craigh411 (21 commits)")[![mskarupianski](https://avatars.githubusercontent.com/u/973723?v=4)](https://github.com/mskarupianski "mskarupianski (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/craigh-alexa-request-validator/health.svg)

```
[![Health](https://phpackages.com/badges/craigh-alexa-request-validator/health.svg)](https://phpackages.com/packages/craigh-alexa-request-validator)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
