npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@genie-ai/genie-router-plugin-google-assistant

v2.0.0

Published

Genie Router plugin to interact with the Google assistant.

Downloads

14

Readme

This plugin is built on the excellent google-assistant module. It enables communication with the Google Assistent via the genie-router clients.

Its configuration consists of three steps:

  1. Configure a Google Cloud project
  2. Install the plugin
  3. Link your Google credentials

Google Cloud Configuration

Follow the instructions to create a JSON file for OAuth2 permissions.

Verify using an 'official' Assistant client (Android phone, Google Home, etc), that you can use the Assistant with your account. Google Apps accounts for example need to have it explicitly enabled.

Install plugin

Plugin configuration

googleClientSecretPath

Required. This is the file path to the .json file you create by following the instruction for the enabling of the API on Google Cloud.

tokensStorePath

Required. The filename to store the authorization tokens that link your Google account to the Cloud project client id.

locale

Optional. The locale to use. Defaults to the en-US locale.

Example

{
  "plugins": {
    "google-assistant": {
      "googleClientSecretPath": "<path to google client_secret...json",
      "tokensStorePath": "<path to store received google tokens.json>",
      "locale": "en-US"
    }
  }
}

Link your Google credentials

The assistent requires a Google account to work. Change to your plugin location folder ($HOME/.genie-router by default). Install the plugin by running:

npm install --save matueranet/genie-router-plugin-google-assistant

After installation has completed, run (still in your plugin folder):

./node_modules/.bin/google-assistant-setup

This will start the linking process of your Google account. It will output something similar to:

Attempted to automatically open the URL, but if it failed, copy/paste this in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype&response_type=code&...
Paste your code: (node:996) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3

The unhandled promise rejection can be ignored. Open the URL in your browser, login and authorize the app to use your account. Copy the code displayed, and paste it in the console and press enter. The process should continue and output: Assistant initialized. Next time you run the script it should not show the URL again, but immediately echo the Assistant initialized output.

Future improvements

  • Simplify generating an accessToken for the Google account by doing an OAuth flow from the webbrowser.