This sample demonstrate how to use new Paid Skill feature of Alexa skills to inform user to purchase skill before using skill.
Each skill consists of two basic parts, a front end and a back end. The front end is the voice interface, or VUI. The voice interface is configured through the voice interaction model. The back end is where the logic of your skill resides.
There are a number of different ways for you to setup your skill, depending on your experience and what tools you have available.
- If this is your first skill, choose the Alexa-Hosted to get started quickly.
- If you want to manage the backend resources in your own AWS account, you can follow the AWS-Hosted instructions.
- Developers with the ASK Command Line Interface configured may follow the ASK CLI.
- If you want to host the backend code in Alexa developer account (Alexa Hosted skill) then you can directly create hosted skill by importing Github repository.
Important: This sample code showcase how you can use Paid skill feature to give option for user to buy Alexa skill first before using it. Once user purchased this skill and then they can get chuk norris jokes.
First you need to create Paid Skill product which can be done directly in developer console or through ASK CLI commands.
Run below create-isp-for-vendor command if you are using ASK CLI to create Paid skill product
ask smapi create-isp-for-vendor paid-manifest.json
Run below associate-isp-with-skill command to associate ISP with with skill. In Paid skill Product ID is the same as skill Id.
ask smapi associate-isp-with-skill --product-id <Skill Id> --skill-id <Skill Id>