1.0.8 • Published 6 years ago

alexa-skill-sdk-for-azure-function v1.0.8

Weekly downloads
11
License
ISC
Repository
github
Last release
6 years ago

alexa-skill-sdk-for-azure-function

Alexa skill sdk for Node.js for azure function. It's a wrapper of Alexa skills kit sdk for Node js for Azure Function

Installation

  $ npm install alexa-skill-sdk-for-azure-function

Usage

In index.js of azure function

    module.exports = function (context, req) {
        var alexa = require('alexa-skill-sdk-for-azure-function');
        alexa.setup({
            azureCtx: context,
            azureReq: req,
            handlers: null,
            trackInvokedIntents: true,
            enforceVerifier: false,
            i18nSettings: i18nSettings
        });
        
        alexa.execute(avsCallback(context, req));
    }

    var avsCallback = function (azureCtx, req) {
        return function (err, obj) {

            if (err) {
                azureCtx.res = {
                    status: 400,
                    body: err
                };
            } else {
                azureCtx.res = {
                    body: obj
                };
            }
            azureCtx.done();
        };
    };

Options to setup alexa sdk for azure function:

  • azureCtx: The context of azure function
  • azureReq: The request object of azure function (http trigger)
  • handlers: Array of Handlers for alexa skill
  • trackInvokedIntents If you want to track invoked intents, then this would be stored in session attributes as invokedIntents: string[] and lastIntent: string. Default value: false
  • enforceVerifier If you want to enforce certificate verification for alexa, then pass the "true" boolean flag. Default value: true
  • alexaAppId This would be app id of your alexa skill. You can either pass this through this property or set the app settings of "ALEXA_APP_ID"
  • i18nSettings This is the setting for i18next. It should be an object of two properties
    {
        "interpolation": object,
        "languageStrings": object
    }
  • version Version of the application
  • name Name of the application
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago