O'Reilly logo

Alexa Skills Projects by Madhur Bhargava

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Coding the Lambda function

We will be editing the code inline, in the index.js file on the developer portal itself:

  1. Implement the handling of events in exports.handler. Our Lambda will be handling two basic requests:
    • LaunchRequest: To handle the launch of the skill
    • IntentRequest: To handle various intents (in our case we have just two intents, the first one being the fetchPrice intent, which asks the Lambda to fetch the price of a specific cryptocurrency, and AMAZON.StopIntent, which indicates an exit from the skill)

We'll start by segregating each of the requests that our skill receives. For this, declare the following handler:

exports.handler = function (event, context) {    try {        if (event.request.type === "LaunchRequest") {            

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required