An example Alexa skill project that is using Kask library.
Kask is designed to improve developer experience for Alexa skills on JVM.
This example demonstrates it's usage in Kotlin and Java.
This example can run both on AWS Lambda and as a JVM servlet (so you can run it locally or on your own server).
-
Clone this repository.
-
cd
to the code location -
Run
./gradlew appRun
.Alternatively, you can open and run the project from within your favorite IDE.
At this point, you have a fully functional Alexa skill running at http://localhost:8080/hello-kask/skill.
-
Make your skill accessible via public https endpoint:
bst proxy http 8080
This command will give you a publicly accessible url in a form ofhttps://<unique-id>.bespoken.link/
, where unique id would be specific for you. It will redirect all requests tohttp://localhost:8080/
. -
Now you can test your skill by running commands like these (from within the project directory):
bst launch -u https://<unique-id>.bespoken.link/hello-kask/skill
- to sendLaunchRequest
to your skill;bst intend RepeatDurationIntent durationSlot=PT10S -u https://<unique-id>.bespoken.link/hello-kask/skill
- send a request with theRepeatDurationIntent
intent, providing thedurationSlot
slot value to your skill;bst utter "repeat PT10S" -u https://<unique-id>.bespoken.link/hello-kask/skill
- send an utterance to your skill resulting in the same invocation to your skill as in previous command.
See more at: https://read.bespoken.io/cli/commands/
To actually make Alexa talk to your skill you need to create a skill in Alexa skills Kit Developer Console.
Afterward, you can either run skill on AWS Lambda as the link above suggest (to create a Lambda package - run ./gradlew buildLambdaArchive
). Or make Alexa talk directly to the skill running on your computer.
If you'd like to go with the second option - you need to follow the skill creation guide in all points but one. When it's time to set up endpoint
:
- Select
HTTPS
instead ofAWS Lambda
- Make your skill accessible via public https endpoint, as described in a section above.
- For endpoint URI enter:
<URL you've obtained in the previous step>/hello-kask/skill
. - For "Select SSL certificate type" select
My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority
option.
Now Alexa should be able to talk to your skill.
Please refer to official ASK SDK Documentation for more guides and examples on general skill development.
And to Kask repository on more details how to use it.
./gradlew buildLambdaArchive
See example here: https://github.com/Stvad/alexa-life-advice
- Alexa Life Advice - a skill that I'm developing using kask. It can serve as a further inspiration and source of examples.