Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Google Hangouts Chat: auth on Heroku/Dokku nodes etc #1533

Closed
julbrs opened this issue Dec 6, 2018 · 3 comments
Closed

Google Hangouts Chat: auth on Heroku/Dokku nodes etc #1533

julbrs opened this issue Dec 6, 2018 · 3 comments

Comments

@julbrs
Copy link
Contributor

julbrs commented Dec 6, 2018

Hello

I am testing BotKit with the Google Hangouts Chat Bot, and it working really well locally ! Good job ! (https://github.com/howdyai/botkit-starter-googlehangouts)

I am planning to deploy it on a Dokku/Heroku instance and I am hitting a wall:

I need to set to set the environment variable GOOGLE_APPLICATION_CREDENTIALS as a link to the google json auth file (like auth.json) but I don't want to put this file on git so I can't push it to Dokku.

The solution proposed by Google seems pretty easy to implement buy I don't know how to do this in my BotKit :)

Here is my code for another project using Google Hangouts Bot auth that is working well with that:

// load the environment variable with our keys
const creds = process.env.CREDS
if (!creds) {
  throw new Error('The $CREDS environment variable was not found!');
}
const keys = JSON.parse(creds)
const client = auth.fromJSON(keys)
client.scopes = ['https://www.googleapis.com/auth/chat.bot']

module.exports = google.chat({
  version: 'v1',
  auth: client
});

Do you have an idea ?

Thanks !

@julbrs
Copy link
Contributor Author

julbrs commented Dec 12, 2018

Hello

I have created a pull request that allow this behavior : #1543

Thanks !

@ouadie-lahdioui
Copy link
Collaborator

ouadie-lahdioui commented Dec 13, 2018

Hi @bobman38, i'll take a look asap.

Thank you

@benbrown
Copy link
Contributor

This will be in the next published version of Botkit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants