How to Connect Botanalytics SDK to Amazon Alexa Skill
This tutorial assumes that you have already finished the previous tutorial and have a working Amazon Alexa Skill in Node.js.
Prerequisites
- An NPM project. For information on how to set up a NPM project, please see this
- A suitable Node.js development environment. The ASK SDK v2 for Node.js requires Node 4.3.2 or above.
- A working Amazon Alexa Skill code written in Node 8.11.x or above.
Adding the Botanalytics to Your Project
- From within your NPM project, run the following commands to install the standard Botanalytics SDK for Node.js distribution:
npm install --save botanalytics
Configuring Botanalytics Account
- First you need to add a new bot for Amazon Alexa Skill interaction.
2. Select your platform as Amazon Alexa.
3. After that, you could get your Botanalytics Token.
Implementing Botanalytics Handler
First you need to add your Botanalytics token into an environment variable. After that you could call Botanalytics NPM package with this token. You can pass debug option as a parameter to botanalytics in order to see more information while integrating your Amazon Alexa Skill.
const Botanalytics = require('botanalytics').AmazonAlexa(process.env.BOTANALYTICS_TOKEN, {
debug: true
});
Wrapping Lambda Handler
After initial configuration, you need wrap your lambda handler with botanalytics handler in order to data exchange between your Amazon Alexa Skill and Botanalytics.
//Lambda handler function wrapper example
exports.handler = Botanalytics.handler(lambda);
Check your Botanalytics Amazon Alexa Skill Bot
You can see everything related with your Amazon Alexa Skill on this dashboard.
Again most common phrases and most common hours that have been used for interacting with your Amazon Alexa Skill could be seen below:
Check for our demo page for detailed information about our product!