Skip to content
Branch: master
Find file History

README.md

Alexa for Business-Sample device maker service

This is a Node.js application that serves as an example of how an Alexa Voice Service (AVS) device maker can manage their customer's devices built with AVS in Alexa for Business.

Overview

The app has two major components.

  • Console (Client)

    This allows the user to:

    • Store AWS IAM Credentials needed to call Alexa for Business.
    • Set up devices by providing a Device Serial Number (DSN) and a Product ID.
    • Enable devices to be registered to Alexa for Business when they are turned on.
    • Disable devices to be registered to Alexa for Business which also deregisters them.
    • Delete devices that were setup.
  • Service (Server)

    • Demonstrates how to talk to AWS IAM and Alexa for Business using the AWS SDK.
    • Provides a /device/register API that can be called from an AVS device, which will in turn call Alexa for Business to register it there.
    • Provides API's for the operations that can be performed on the console, which can also be called using HTTP requests.

Prerequisites

To build and run these examples, you'll need to:

Running the Sample AVS device maker service locally

Pull this git repository locally and run the following commands.

npm install
npm start

Then, go to http://localhost:3000/ to use the console.

Making AVS Sample app work with Sample AVS device maker service

The AVS Sample application which is bundled within AVS device SDK needs some modification before it can be used with Alexa for Business Sample device maker service to register AVS device with Alexa for Business. Following are the modifications needed to AVS sample app as per AVS client SDK version 1.10:

  1. Changes in AlexaClientSDKConfig.json: The AlexaClientSDKConfig.json file stores configurations used by AVS Sample app. Open and edit file, located at {PATH_TO_AVS_CLIENT_SDK_SRC_FOLDER}/Integration/AlexaClientSDKConfig.json. Locate the "sampleApp" object and add

    • A boolean "registerWithA4B" set it to "true".
    • A string "deviceMakerServiceEndpoint" and set it to IP address of AVS device maker service, for example "http://localhost:3000/device/register".
  2. Changes in UIManager.cpp: The changes made in AlexaClientSDKConfig.json will be consumed by UIManager.cpp. The change is needed in onRequestAuthorization method to check if "registerWithAlexa for Business" is set to true in AlexaClientSDKConfig.json, then call "deviceMakerServiceEndpoint" for registration.

For convenience the two files you need to modify are bundled within this package under "avs-device-sdk-override". Run following commands before you compile AVS device SDK on your device. Note, this assumes you are using AVS device SDK 1.10 and running AVS device maker service and AVS Sample app on same device.

cd {PATH_TO_SAMPLE_DEVICE_MAKER_APP}/avs-device-sdk-override
cp Integration/AlexaClientSDKConfig.json {PATH_TO_AVS_CLIENT_SDK_SRC_FOLDER}/Integration
cp SampleApp/src/UIManager.cpp {PATH_TO_AVS_CLIENT_SDK_SRC_FOLDER}/SampleApp/src

Reference

You can find detailed documentation for the AWS SDK for JavaScript at:

You can’t perform that action at this time.