From 9a3892afd2f5e3a3e7bb384018956663dfcc759a Mon Sep 17 00:00:00 2001 From: Mason Neal Date: Tue, 1 Mar 2016 08:23:46 -0800 Subject: [PATCH] Add an authorization technique to the docs using env vars [Google Auth](https://github.com/google/google-auth-library-ruby) supports environment varibales as a means of authorizing service apps. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index f3fa5b32f..615879ee8 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,18 @@ result = translate.list_translations('Hello world!', 'es', source: 'en') puts result.translations.first.translated_text ``` +### Authorization using environment variables + +The [GoogleAuth Library for Ruby](https://github.com/google/google-auth-library-ruby) also supports authorization via +environment variables if you do not want to check in developer credentials +or private keys. Simply set the following variables for your application: + +```sh +GOOGLE_ACCOUNT_TYPE="YOUR ACCOUNT TYPE" # ie. 'service' +GOOGLE_CLIENT_EMAIL="YOUR GOOGLE DEVELOPER EMAIL" +GOOGLE_PRIVATE_KEY="YOUR GOOGLE DEVELOPER API KEY" +``` + ## Samples Samples for versions 0.9 and onward can be found in the `samples` directory.