Alexa Skills Kit (ASK) SDK for Node.js

repository·2.0.x·Indexed 25 days ago

https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs

A high-level framework for building Alexa skills that abstracts JSON request/response models into TypeScript/JavaScript classes. The SDK includes core modules (ask-sdk-core, ask-sdk-model), persistence adapters for DynamoDB and S3, an Express adapter for custom web services, and tools for local debugging and SMAPI integration.

Tokens
13.7K
Snippets
38
Records
120
Agent score
84%

What's inside alexa-skills-kit-sdk-for-nodejs

  1. Overview of Alexa Skills Kit SDK for Node.js

    2.0.x

    The ASK SDK v2 for Node.js is designed to simplify the development of highly engaging Alexa skills by reducing boilerplate code. It allows developers to focus on implementing features rather than handling low-level request/response logic.

    Key components include:

    • ASK SDK v2: The standard distribution for building skills.
    • ASK SDK Controls Framework (Beta): A scalable solution for large, multi-turn skills using reusable components called controls.
    • ASK SMAPI SDK: A library for interacting with Skill Management APIs (SMAPI), including interaction models, intent request history, and in-skill purchasing APIs.
  2. Supported Alexa Features in ASK SDK v2 for Node.js

    2.0.x

    The ASK SDK v2 for Node.js supports a wide range of Alexa features, including:

    • Payments & Monetization: Amazon Pay and Monetization.
    • Media & Display: Audio Player, Video, and Display (Body templates for screen devices).
    • Interactions: Dialog Management, Entity Resolution, Dynamic Entity, and Name-free Interactions (Preview).
    • Services & APIs: Directive Service (Progressive Response), Messaging, Reminders, Location Services, and Alexa Settings API.
    • User Data & Identity: Account Linking, Device Address, Lists (Shopping and To-Do), and Request for customer contact information.
    • Hardware: Gadgets Game Engine (Echo Buttons).

    Note: Some features like Connections and Alexa Presentation Language (APL) are currently in Public Preview and their interfaces may change in future releases.

  3. Getting Started with the ASK SDK

    2.0.x

    To begin using the ASK SDK v2 for Node.js, you can follow these primary guides:

    1. Setting Up The ASK SDK: Instructions for installing the SDK as a dependency in your NPM project.
    2. Developing Your First Skill: A step-by-step walkthrough for building a 'Hello World' sample skill.
    3. ASK SDK Migration Guide: Instructions for migrating existing Alexa skills from SDK v1 to SDK v2.
  4. Technical Documentation Overview

    2.0.x

    The ASK SDK provides several core technical capabilities for skill development:

    • Processing Request: Learn how to build request handlers, exception handlers, and request/response interceptors.
    • Building Response: Use the ResponseBuilder to compose text, cards, and audio into a single response.
    • Managing Attributes: Store and retrieve skill data using skill attributes.
    • Calling Alexa Service APIs: Use service clients to access various Alexa APIs.
    • Configuring Skill Instance: Learn how to configure and construct a skill instance.
    • ASK SDK Utilities: Use utility functions provided by the SDK.
  5. Explore Alexa Skill Samples

    2.0.x

    The repository provides several sample projects to demonstrate different implementation patterns:

  6. Generate an Access Token using ASK CLI

    2.0.x

    To use the local debugging service, you need an access token generated via the ASK CLI.

    1. Install ASK CLI v2: npm install ask-cli@2 -g.
    2. Run the following command to generate LWA tokens with the required scope: ask util generate-lwa-tokens --scopes alexa::ask:skills:debug
    3. Follow the 'Login with Amazon' prompts in your browser. Retrieve the ACCESS_TOKEN from your terminal after signing in.
    ask util generate-lwa-tokens --scopes alexa::ask:skills:debug
  7. Use ASK SDK Runtime with TypeScript

    2.0.x

    The ask-sdk-runtime package bundles TypeScript definition files. To use them, ensure your project meets these requirements:

    1. Use TypeScript v2.x or higher.
    2. Install TypeScript definitions for Node.js using @types/node.

    To use the definitions in a TypeScript file, import the package as follows:

    import * as Runtime from 'ask-sdk-runtime';
  8. Use the ASK SDK with TypeScript

    2.0.x

    The ask-sdk package bundles TypeScript definition files. To use them in a TypeScript project, ensure you meet the following prerequisites:

    1. Use TypeScript v2.x or higher.
    2. Include TypeScript definitions for Node.js by installing @types/node.

    Import the SDK in your TypeScript files using the following syntax:

    import * as Alexa from 'ask-sdk';