Have you ever wanted to ask Alexa to play the audio of a YouTube video? Just say “Alexa, Ask Hey Tube to play Whitesnake” and listen to a great Whitesnake track from YouTube.
In this article, I will show how to build a Custom Alexa Skill to connect your Amazon Echo device to YouTube.
Note: Keep in mind this skill will not be published in Amazon Store production, and can only be used in development mode. This is not an Amazon approved Skill and should only be used for educational purposes.
The Alexa custom skill is a combination of two main components:
The skill interface defines how your skill will behave:
The skill service contains your code logic to handle the intents and perform actions. The service is deployed as a backend resource. For this exercise — JavaScript deployed in AWS Lambda
This is the custom skill flow to be developed:
The easiest way to create a new Alexa Skill is by using ASK CLI**.**
Before starting, make sure you have an Amazon Developers Account, Node installed, AWS Account, AWS CLI, and ASK CLI installed.
For a complete detailed guide setup of your environment check out my previous article Quickly Build an Alexa Skill Using ASK CLI.
Let’s start by creating the new skill structure: $ ask new
:
ask new
Select:
alexa-skill-heytube
alexa-skill-heytube
Change to your new directory:$ cd alexa-skill-heytube/lambda
Install your packages: $ npm install
#alexa #javascript #programming #lambda #amazon-echo