Subscribe

A wild idea appeared

โœ๏ธ

A wild idea to make a Google Action for my blog

10 Sep, 2022 ยท 3 min read

I got this crazy idea a while ago that it would be super cool to have a custom Google Action that I could load onto my Google home device.

My idea is to be able to ask it for the latest dev tip, and it will prompt back the latest article I've written.

At first, it seemed impossible, but I decided to give it a go. In the following few articles, I'll dive into this quest, and hopefully, we'll be able to create it.

Getting started

For this article in specific, we'll get started with the rough setup and gather the pieces we'll need.

The first thing you'll need is a Google Action developer account. You can simply follow the steps on the page.

Once logged in, you can create your first action on the webpage. You can pick and of the existing samples to get started.

Once you have created one, you'll be able to get into the visual editor of Google Actions.

For now, we'll be using that. If you go to the Settings tab, you'll be able to choose the display name. This will be the name of your application.

In my case, I went with "Daily Dev Tip".

Google Actions display name

Then we can move on to the main invocation, which will be the action that happens when users interact with our app. In my case, I dummy-mocked what I wanted to happen.

In the Invoke tab, I added the following YAML to mock the actions that should happen.

candidates:
  - first_simple:
      variants:
        - speech: Here is the latest dev tip
    content:
      card:
        title: Some article
        text: Summary
        image:
          URL: 'https://developers.google.com/assistant/assistant_96.png'
          alt: Article description

This will result in Google first saying: "Here is the latest dev tip", and showing the rich article card.

This will look something like this:

Google action testing

That is already perfect but, of course, still super static. We'll need to figure out how to query our endpoint to get the latest article.

More on that in the following articles. If you are keen to learn with me, don't forget to subscribe to my newsletter not to miss any articles.

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Spread the knowledge with fellow developers on Twitter
Tweet this tip
Powered by Webmentions - Learn more

Read next ๐Ÿ“–

Google actions recap

16 Sep, 2022 ยท 2 min read

Google actions recap

Deploying a Google action

15 Sep, 2022 ยท 2 min read

Deploying a Google action

Join 1828 devs and subscribe to my newsletter