Skip to content

Commit

Permalink
docs: update API key generation steps (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored Nov 16, 2016
1 parent d6d9590 commit bd9aeca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/google-cloud-translate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ If you are not running this client on Google Compute Engine, you need a Google D
3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services):
* Google Translate API
4. Navigate to **APIs & auth** > **Credentials** and then:
* If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests.
* If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file.
* If you want to use a new service account key, click on **Create credentials** and select **Service account key**. After the account key is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests.
* If you want to generate a new service account key for an existing service account, click on **Generate new JSON key** and download the JSON key file.
* If you want to use an API key, click on **Create credentials** and select **API key**. After the API key is created, you will see a newly opened modal with the API key in a field named **Your API key** that the library uses to authenticate your requests.
* If you want to generate a new API key for an existing API key, click on an existing API key and click **Regenerate key**.

``` js
var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123'
Expand All @@ -100,6 +102,9 @@ var translate = require('@google-cloud/translate')({

// Or the contents of the key file:
credentials: require('./path/to/keyfile.json')

// Your API key (if not using a service account JSON file):
key: '...'
});

// ...you're good to go!
Expand Down

0 comments on commit bd9aeca

Please sign in to comment.