github alexa/alexa-skills-kit-sdk-for-nodejs v1.0.10

latest releases: v2.14.0, v2.12.1, v2.12.0...
6 years ago

This release adds support for the Lambda callback parameter. (Note: this is only supported in lambda functions which use NodeJS V4.3 or v6.10)

When using the callback function, lambda will wait for the event loop is empty before exiting. This is useful if you have cleanup / instrumentation or other post response activities that may not complete before this.emit(':responseReady') is called.

You can take advantage of the callback function by adding it as the third parameter when creating a new Alexa.handler()

var Alexa = require("alexa-sdk");

exports.handler = function(event, context, callback) {
    var alexa = Alexa.handler(event, context, callback);  // pass callback to the Alexa.handler
    //...
};

Lambda callback documentation: http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html

We've also changed the this.emit(':saveState') to not call context.succeed|callback to resolve #88

Major changes:
Replace this.context.fail(error) with this._callback(error) and this.context.succeed(response) with this._callback(null, response) - Thanks @phimar
Remove context.succeed/callback calls from saveState - Thanks @knowlsie
Documentation updates - thanks @feynmanliang, @knowlsie , @katz, @muttoni, @imTachu

Don't miss a new alexa-skills-kit-sdk-for-nodejs release

NewReleases is sending notifications on new releases.