# alexa-skill-sdk-for-azure-function

> Alexa sdk for azure function

Latest version **1.0.8** (published 2018-04-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install alexa-skill-sdk-for-azure-function
pnpm add alexa-skill-sdk-for-azure-function
yarn add alexa-skill-sdk-for-azure-function
bun add alexa-skill-sdk-for-azure-function
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2018-04-23 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Ramji Piramanayagam |
| Maintainers | ramji.p |
| Keywords | alexa, amazon, lambda, azure, function, sdk, skill |

## Links

- npm: https://www.npmjs.com/package/alexa-skill-sdk-for-azure-function
- Repository: https://github.com/RamjiP/alexa-skill-sdk-for-azure-function
- Homepage: https://github.com/RamjiP/alexa-skill-sdk-for-azure-function#readme
- Issues: https://github.com/RamjiP/alexa-skill-sdk-for-azure-function/issues
- npm.io page: https://npm.io/package/alexa-skill-sdk-for-azure-function

## Dependencies (2)

- [alexa-sdk](https://npm.io/package/alexa-sdk.md) ^1.0.25
- [alexa-verifier](https://npm.io/package/alexa-verifier.md) ^1.0.0

## Recent versions

- 1.0.8 (latest) — 2018-04-23
- 1.0.7 — 2018-03-29
- 1.0.6 — 2018-03-27
- 1.0.5 — 2018-02-14
- 1.0.4 — 2018-02-14
- 1.0.3 — 2018-02-14
- 1.0.2 — 2018-02-13
- 1.0.1 — 2018-02-05
- 1.0.0 — 2018-02-01

## README

# 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][0] for [Azure Function][1]


## Installation

``` bash
  $ npm install alexa-skill-sdk-for-azure-function
```

## Usage
In index.js of azure function
``` js

    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][2] 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][3].  It should be an object of two properties 

```json
    {
        "interpolation": object,
        "languageStrings": object
    }
```
* __version__ Version of the application 
* __name__ Name of the application

[0]:https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs
[1]:https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node
[2]:https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs#implement-handler-functions 
[3]:https://www.i18next.com

---
_Source: https://npm.io/package/alexa-skill-sdk-for-azure-function · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
