Alexa Request
This library is meant to parse an incoming Alexa request and return a function version all the request so that you can easily access the data you need.
Installation
$ npm install --save alexa-req
Usage
; // get the body from your requestconst body = requestbody; // create a new AlexaRequest objectconst alexa = body;
Functions
getSessionId
Returns the sessionId from the request
const alexa = body;const sessionId = alexa;
getUserId
Returns the user alexa userId
const alexa = body;const userId = alexa;
getRequestType
Returns the request type
const alexa = body;const requestType = alexa;
getIntentName
Returns the name of the alexa intent
const alexa = body;const intent = alexa;
getSlotValue
Returns the value from a given slot. Will return an error if the slot does not exist.
const alexa = body;const value = alexa;
verifyAppId
Verifies if the request has the correct api id
const alexa = body;const isValid = alexa;