I've been developing Alexa skills using Python for a while but am currently having trouble developing a skill using Node JS. There appears to be at least two AWS-supported alternative approaches to handling a skill with Node JS. I'm interested in the two approaches that are utilised in Lambda blueprints for Alexa: (1) the approach in which the Alexa SDK is explicitly utilised, i.e.
const Alexa = require('alexa-sdk');
and (2) the approach in which the Alexa SDK is NOT explicitly utilised.
Here is an example of a blueprint that explicitly utilises the Alexa SDK:
The main distinguishing feature of this approach seems to be that the response of an intent handler is sent to the device by invoking built-in SDK methods such as
Here is an example of a blueprint that does not explicitly utilise the Alexa SDK:
The main distinguishing feature of this approach seems to be that the JSON response is built by the intent handler calling a helper method that resides within the Lambda, e.g.
buildSpeechletResponse(title, output, repromptText, shouldEndSession);
Can someone please explain to me the rationale for having these two approaches supported by blueprints and under which circumstances the use of one is preferable to the other? What is the best practice here?
I'm aware of other approaches, e.g. alexa-app, see: https://github.com/alexa-js/alexa-app/blob/master/index.js but I'm really only interested in the two approaches for which AWS provides Lambda blueprints. I've seen answers to some similar questions on the forum, but they are all several years old and do not address the question in sufficient depth.