Canvas Alexa Lambda is the lambda function that runs all intents present in the Canvas-LMS Alexa Skill.
To get started, set up your .lambda-dev
file. The .lambda-dev-example
file includes a basic setup; however,
you will still need to get your own access key for the host you are running against. For the best local development
experience (and the easiest to track requests/problems), clone and run Canvas-lms locally. This process will help you keep the default host in the .lambda-dev-example
.
Then, visit your users settings (<host>profile/settings
) to create an access token and paste it into the .lambda-dev
file.
After that you should be able to run the devScript.sh
with the intent you would like to test.
A list of possible intents can be found in intents.json
:
Docker
docker build -t alexalambda .
docker run -it --rm alexalambda ./bin/devScript.sh <intentName>
local
yarn
./bin/devScript.sh <intentName>
The script will run the lambda with some dummy session and context data and return the output of your intent in the saml field.
example:
$ ./bin/devScript.sh GetBlackboard
response for Intent: GetBlackboard
{ version: '1.0',
response:
{ shouldEndSession: false,
outputSpeech:
{ type: 'SSML',
ssml: '<speak> You must be crazy. Anything else? </speak>' },
reprompt: { outputSpeech: [Object] } },
sessionAttributes: 'mock session attributes' }
You will either need:
or
Node v10.22.0.
You can use npm if you would like; however, we use Yarn for this project.
We use jest for testing the canvas alexa lambda:
Docker
docker run alexalambda yarn test
local
yarn test
We use prettier in this project. Once you are comfortable with your intent or change you can run:
yarn lint
This will auto format your code to our prettier standard.
- Alexa-AWS-SDK - The library to handle intents
- Node - javascript engine
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the GNU AFFERO GENERAL PUBLIC License - see the LICENSE file for details.