Implementation of the Google Assistant API for Alexa
THIS SKILL IS FOR PERSONAL USE ONLY AND IS NOT ENDORSED BY GOOGLE OR AMAZON. WHILST THIS SKILL USES AN OFFICIAL GOOGLE API, IT WILL NEVER PASS AMAZON CERTIFICATION DUE TO THE WAY THE RESPONSES ARE HOSTED.
- Supports Node.js 20.x
- Supports for ASK CLI deployment all-in-one skill and CloudFormation stack with optional local building using docker
- Added support for device location converting Alexa skill device address to location coordinates using Google Maps Geocode API
- Added localized skill translations for all supported languages between the Google Assistant and Alexa API
- Replaced deprecated render template interface with simple cards display when text response available
- No longer need to upload
client_secret.json
as replaced by Lambda environmental variables - Refactor code separating functionalities and upgrading to ASK SDK v2
- Added automated build release via GitHub actions
-
Prerequisites
-
To deploy this skill, you will need the following tools:
-
To determine your Google OAuth2 client authorized redirect URIs, add your Alexa Vendor ID to the links below:
https://layla.amazon.com/api/skill/link/<vendorId>
https://pitangui.amazon.com/api/skill/link/<vendorId>
https://alexa.amazon.co.jp/api/skill/link/<vendorId>
-
Setup your Google environment by following the Google-related installation instructions only, skipping all Amazon-related steps, and taking note of the Project ID that was created. Once completed, create your Google Maps API key as follow:
- Enable the Google Maps Geocoding API under the same project.
- Enable the billing for the project. (Usage should be covered by monthly free tier credit)
- Create a new API key credential and edit it:
- Change name to
google_assistant
- Leave application restrictions to none
- Set API restrictions to the Geocoding API only.
- Change name to
-
Configure your
GoogleProjectId
andGoogleMapsApiKey
inask-resources.json
. To enable debug logs, addLambdaDebug
set totrue
in the skill infrastructure cloudformation user config parameters. -
Configure your Google Assistant API
clientId
andclientSecret
inaccountLinking.json
-
If your default language isn't English (US):
-
Configure your deploy
awsRegion
inask-resources.json
based on the table below:Skill Language Endpoint Region Deploy Region English (CA), English (US), French (CA),
Portuguese (BR), Spanish (MX)North America us-east-1
English (UK), French (FR), German,
Italian, Spanish (ES)Europe eu-west-1
English (IN) India eu-west-1
English (AU), Japanese Far East us-west-2
-
-
If upgrading from v2:
- Create the ASK CLI states file as
.ask/ask-states.json
, adding the Skill ID listed under your Alexa developer console. This will prevent duplicate skills from being created under your account.{ "askcliStatesVersion": "2020-03-31", "profiles": { "default": { "skillId": "<skillId>" } } }
- Delete your existing
AlexaAssistant
CloudFormation stack under your AWS console.
- Create the ASK CLI states file as
-
If deploying from a Windows environment:
- Allow the build script to be executed by setting the current user PowerShell execution policy to
RemoteSigned
.Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
- Allow the build script to be executed by setting the current user PowerShell execution policy to
-
-
Deploy the skill and the lambda function in one step:
ask deploy
-
Update the skill account linking information using the Skill ID displayed in previous step:
ask smapi update-account-linking-info -s <skillId> --account-linking-request file:accountLinking.json
-
Enable the skill on your Alexa account:
- Go to your Alexa app > More > Skills & Games.
- Select the "Google Assistant" skill under Your Skills > Dev tab.
- Tap "Enable to Use", go through the account linking process and grant the "Device Country and Postal Code" permission.