All Projects → alexa-js → alexa-verifier-middleware

alexa-js / alexa-verifier-middleware

Licence: MIT license
An express middleware that verifies HTTP requests sent to an Alexa skill are sent from Amazon.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to alexa-verifier-middleware

Chatskills
Run and debug Alexa skills on the command-line. Create bots. Run them in Slack. Run them anywhere!
Stars: ✭ 171 (+451.61%)
Mutual labels:  alexa, amazon, alexa-skill
alexa-ruby
Ruby toolkit for Amazon Alexa service
Stars: ✭ 17 (-45.16%)
Mutual labels:  alexa, amazon, alexa-skill
Alexa Skill Kit
Library for effortless Alexa Skill development with AWS Lambda
Stars: ✭ 278 (+796.77%)
Mutual labels:  alexa, amazon, alexa-skill
Voicewp
Create Alexa Skills through WordPress
Stars: ✭ 132 (+325.81%)
Mutual labels:  alexa, amazon, alexa-skill
Amazon Alexa Php
Php library for amazon echo (alexa) skill development.
Stars: ✭ 93 (+200%)
Mutual labels:  alexa, amazon, alexa-skill
go-avs
A simple package for communicating with Amazon’s HTTP/2 API for AVS.
Stars: ✭ 25 (-19.35%)
Mutual labels:  alexa, amazon
Awesome Voice Apps
🕶 A curated list of awesome voice projects, tools, and resources for Amazon Alexa, Google Assistant, and more.
Stars: ✭ 138 (+345.16%)
Mutual labels:  alexa, alexa-skill
Home-Assistant
Home-Assistant-Config
Stars: ✭ 186 (+500%)
Mutual labels:  alexa, amazon
Alexaskillskit
Swift library to develop custom Alexa Skills
Stars: ✭ 160 (+416.13%)
Mutual labels:  alexa, alexa-skill
Jovo Framework
🔈 The Open Source Voice Layer: Build Voice Experiences for Alexa, Google Assistant, Samsung Bixby, Web Apps, and much more
Stars: ✭ 1,320 (+4158.06%)
Mutual labels:  alexa, alexa-skill
Jaicf Kotlin
Kotlin framework for conversational voice assistants and chatbots development
Stars: ✭ 160 (+416.13%)
Mutual labels:  alexa, alexa-skill
alexa-skill-heytube
Alexa Skills to Play a Single Audio or Multiple Audio from YouTube Videos
Stars: ✭ 26 (-16.13%)
Mutual labels:  alexa, alexa-skill
Alexa Voice Service.js
Library for interacting with Alexa Voice Service (AVS) in the browser.
Stars: ✭ 123 (+296.77%)
Mutual labels:  alexa, amazon
Alexafsm
With alexafsm, developers can model dialog agents with first-class concepts such as states, attributes, transition, and actions. alexafsm also provides visualization and other tools to help understand, test, debug, and maintain complex FSM conversations.
Stars: ✭ 103 (+232.26%)
Mutual labels:  alexa, alexa-skill
Go Alexa
A collection of Amazon Echo / Alexa tools for Go development.
Stars: ✭ 245 (+690.32%)
Mutual labels:  alexa, amazon
Homeassistant Config
Stars: ✭ 211 (+580.65%)
Mutual labels:  alexa, amazon
alexa-spotify-connect
Control Spotify Connect devices with Alexa
Stars: ✭ 92 (+196.77%)
Mutual labels:  alexa, amazon
Alexacontrolledsamsungtv
Control your Samsung smart TV via amazon alexa
Stars: ✭ 73 (+135.48%)
Mutual labels:  alexa, alexa-skill
alexa-typescript-starter
This is a simple starter project for Alexa skills using Typescript.
Stars: ✭ 38 (+22.58%)
Mutual labels:  alexa, alexa-skill
Home Assistant
Home-Assistant-Config
Stars: ✭ 182 (+487.1%)
Mutual labels:  alexa, amazon

alexa-verifier-middleware

NPM

NPM Version

example workflow

An express middleware that verifies HTTP requests sent to an Alexa skill are sent from Amazon.

Version 2.x is now a pure es module, and requires node 12.17 or higher. If you want to run this via an older version of node, use [email protected]

Usage

It is recommended that you attach all Alexa routes to an express Router.

import express  from 'express';
import verifier from 'alexa-verifier-middleware';


const app = express();

// create a router and attach to express before doing anything else
const alexaRouter = express.Router();
app.use('/alexa', alexaRouter);

// attach the verifier middleware first because it needs the entire
// request body, and express doesn't expose this on the request object
alexaRouter.use(verifier);

// Routes that handle alexa traffic are now attached here.
// Since this is attached to a router mounted at /alexa,
// this endpoint will be accessible at /alexa/weather_info
alexaRouter.get('/weather_info', function (req, res) { ... });

app.listen(3000);

Common errors

The raw request body has already been parsed.

  • This means that you're probably using one of the body-parser middlewares and it is loaded before this one. To fix it, you should load the body-parsers after this one.

Before:

const alexaRouter = express.Router();
app.use('/alexa', alexaRouter);

// INCORRECT
alexaRouter.use(bodyParser.json());
alexaRouter.use(verifier);

After:

const alexaRouter = express.Router();
app.use('/alexa', alexaRouter);

// CORRECT
alexaRouter.use(verifier);
alexaRouter.use(bodyParser.json());

Mentions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].