Essence Helper is a voice app compatible with Google Assistant and Amazon Alexa that retrieves information about ZenithVR MMORPG.
This project is made using Jovo Framework with the goal to avoid duplicate logic and code while developing the skill for Alexa and Google Assistant.
Before discovering this framework, I've developed the same skill for both platforms using their own SDKs:
Previous Alexa Skill repository:
https://github.com/Markkop/essence-helper-alexa-skill
Previous Google Action repository:
https://github.com/Markkop/essence-helper-google-action
-
Google Assistant Actions:
https://assistant.google.com/services/a/uid/0000005dbaeb2c8d?hl=en-US -
Alexa Skill Store:
https://www.amazon.com/dp/B09T6XJ3NT
- Install Jovo CLI with
npm install -g @jovotech/cli
- Install and setup ASK CLI following these instructions.
- Install and setup Gactions CLI following these instructions
- I suggest installing it with
npm i -g @assistant/gactions
instead of the zip file as indicated in the guide above. - Run
npm install
in the root folder of the project
- Run
jovo run
- Press
.
to open web interface - Interact with the app by sending requests to Jovo Debugger.
- Run
jovo run
- Run
npm run deploy:<platform>:dev
to set the remote webhook url to the local jovo webhook. - Read the deploy section below for more information
- Interact with the remote console (Google Assistant Simulator or Alexa Simulator)
- Or interact with your app directly using a platform device (Echot Dot/Google Nest, for example) given the satisfied requirements:
- Alexa Docs: Test your skill on an Alexa-enabled device
- Google Docs: Google Simulator on-device
To run unit tests for the jovo app itself simply run npm run test
To simulate requests directly to the Alexa Skill, run npm run test:dialog
.
This will run ask dialog -r replay_file.json
for each dialog replay file inside test/alexa/dialog-replays
.
Make sure to deploy the dev
or prod
endpoint according to the testing you want to make.
For replaying a single file, run ./scripts/alexa-dialogs.sh -f <filename>
as in ./scripts/alexa-dialogs.sh -f launch
, for example.
To simulate requests to the Google Action, first setup a service account by following these instructions.
Then run npm run enable-activity-controls
only once.
Finally you can run npm run test:google
To able to run the latest draft version, the test rewrites the app preview everytime you run the test suite.
If you want to keep running tests without changes in the action model and settings, you may skip this rewriting.
Run npm run test:google:norewrite
in this case.
Running npm run deploy:<platform>:<stage>
will deploy the model and platform settings within three steps:
- It will first get files from remote console and put them in the
build
folder - Then it will build files from Jovo Models and other custom settings adding and replacing files in
build
folder - Finally it will deploy the files in the
build
folder to the platform console
Note: we get them first to keep some of the settings we have already set in previous builds and/or keep settings we've inputted in the console.
The difference between stage dev
and prod
is the endpoint we're setting for the app.
With the dev
endpoint, we're able to have all the requests routed to our Jovo App instance locally and therefore test our code using the platform console or device.
Just make sure to run jovo run
once to copy the Jovo Webhook Endpoint and save it as an env
variable (JOVO_WEBHOOK_URL
)
Note: the only reason to use the Jovo Webhook Endpoint from an env
variable and not the default project setting variable is because of Alexa's regions endpoint settings that have to be set in a customized manner as coded at jovo.project.js
. Although Alexa Console says that the NA endpoint is optional, if setting it empty the webhook won't work.
Running npm run deploy:code
will deploy the code to the AWS Lambda function using Jovo integration with Serverless CLI and AWS Lambda integration.
You might need to install Serverless CLI: npm i -g serverless
and configure it
Then you will need to export your AWS Credentials or configure serverless with the following command:
serverless config credentials \
--provider aws \
--key AKIAIOSFODNN7EXAMPLE \
--secret wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY