Skip to content

Releases: alexa/alexa-skills-kit-sdk-for-nodejs

Release of ask-sdk-core@2.0.1

19 Apr 23:06
Compare
Choose a tag to compare

This release contains a bug fix of parsing SSML string.

Release of the ASK SDK v2 for Node.js

18 Apr 15:29
Compare
Choose a tag to compare
2.0.0

Release of ASK SDK v2 for Node.js

Enable customized dynamoDB client, fix typos and bump version to 1.0.25

10 Jan 23:12
Compare
Choose a tag to compare

This release added a dynamoDBClient property in alexaRequestHandler so that developer can use their own dynamoDB client, if the dynamDBClient is null, then it will use the default one. The example code of inserting dynamoDB client is as blow:

exports.handler = function(event, context, callback) {
    const alexa = Alexa.handler(event, context);
    alexa.dynamoDBClient = new aws.DynamoDB({
         endpoint: "http://localhost:8000",
         apiVersion: '2012-08-10'
     });
     ...
}

Readme update and bumping version to 1.0.24

14 Dec 23:13
Compare
Choose a tag to compare

This release includes readme update to reflect the latest SDK changes.

Adding userAgent to track the SDK version and language version

07 Dec 00:20
Compare
Choose a tag to compare

This release added the userAgent to track the SDK version and language version.

Manually setting shouldEndSession, bug fix and minor code refactoring

30 Nov 23:25
Compare
Choose a tag to compare

This release added a method shouldEndSession() in responseBuilder to enable setting the shouldEndSession value manually.

This release fixed a bug in ListManagementService so that it supports list API call in Japanese skill.

This release used the ServiceError in DirectiveService, it also did minor code refactoring, eg, using const/let instead of var, using single quote instead of double quotes.

Support for BodyTemplate7

23 Nov 00:00
Compare
Choose a tag to compare

This release adds SDK support for the BodyTemplate7 for display interface

An example to add bodyTemplate7 to Display.RenderTemplate is as follows:

    const builder = new Alexa.templateBuilders.BodyTemplate7Builder();
    const template = builder.setBackgroundImage(Alexa.utils.ImageUtils.makeImage('http://url/to/my/backgroundimg.png'))
                                        .setBackButtonBehavior('HIDDEN')
                                        .setImage(Alexa.utils.ImageUtils.makeImage('http://url/to/my/img.png'))
                                        .build();
    this.response.speak('Rendering a template!')
                .renderTemplate(template);
    this.emit(':responseReady');

Support for Progresive Response API

13 Nov 23:16
Compare
Choose a tag to compare

This release adds SDK support for progressive response API.

The DirectiveService provides the following function to access the Progressive Response API:

enqueue(directive, apiEndpoint, token);

An example to send directive to the service API is as follows:

function callDirectiveService(event) {
    // Call Alexa Directive Service.
    const ds = new Alexa.services.DirectiveService();
    const requestId = event.request.requestId;
    const endpoint = event.context.System.apiEndpoint;
    const token = event.context.System.apiAccessToken;
    const directive = new Alexa.directives.VoicePlayerSpeakDirective(requestId, "This is a message");
    ds.enqueue(directive, endpoint, token)
    .catch((err) => {
        console.log(err.message);
    });
}

Remove unused state from HandlerContext

09 Nov 01:14
Compare
Choose a tag to compare

This release removes an unused state property from HandlerContext.
this.state in handlers is never assigned value nor used in the state management logic. Developers should use this.handler.state instead to manage state value.

List Management API Helper

02 Nov 20:46
Compare
Choose a tag to compare

This release includes a new helper class: ListManagementService that helps developers to better utilize the Alexa List API.

The ListManagmentService provides the following functions to access Alexa List API:

getListsMetadata(token)
createList(listObkect, token)
getList(listId, itemStatus, token)
updateList(listId, listObject, token)
deleteList(listId, token)
createListItem(listId, listItemObject, token)
getListItem(listId, itemId, token)
updateListItem(listId, itemId, listItemObject, token)
deleteListItem(listId, itemId, token)

An example to create a named list is as follows:

const Alexa = require('alexa-sdk');
'CreateListIntent': function () {
        if (this.event.context.System.user.permissions) {
            let token = this.event.context.System.user.permissions.consentToken;

            let lms = new Alexa.services.ListManagementService();
            let listObject = {
                name : 'My Test List',
                state : 'active',
                version : 1
            };
            lms.createList(listObject, token)
                .then((data) => {
                    this.response.speak('List successfully created!');
                     this.emit(':responseReady');
                })
                .catch((error) => {
                    console.log(error.message);
                    this.response.speak('Unable to create List!');
                    this.emit(':responseReady');
                });
        } else {
           this.response.speak('Please grant skill permissions to access Alexa List API.');
           this.emit(':responseReady');
        }
}