diff --git a/README.md b/README.md index a3c723530eb..a7fb2f2b8a8 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,8 @@ If you are not running this client on Google Compute Engine, you need a Google D * Prediction API * Stackdriver Logging 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. ``` js // Authenticating on a global basis. @@ -118,6 +118,9 @@ var gcloud = require('google-cloud')({ // Or the contents of the key file: credentials: require('./path/to/keyfile.json') + + // For any APIs that accept an API key: + key: '...' }); // ...you're good to go! See the next section to get started using the APIs. diff --git a/packages/bigquery/README.md b/packages/bigquery/README.md index 63c7f2fe4f1..97f21a7fb5b 100644 --- a/packages/bigquery/README.md +++ b/packages/bigquery/README.md @@ -72,8 +72,8 @@ 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): * BigQuery 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/bigtable/README.md b/packages/bigtable/README.md index c3d23acd694..89da4d04e3e 100644 --- a/packages/bigtable/README.md +++ b/packages/bigtable/README.md @@ -90,8 +90,8 @@ If you are not running this client on Google Compute Engine, you need a Google D * Cloud Bigtable Admin API * Cloud Bigtable Table Admin 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/compute/README.md b/packages/compute/README.md index f3c5b4163fb..c3c12b0e279 100644 --- a/packages/compute/README.md +++ b/packages/compute/README.md @@ -78,8 +78,8 @@ 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 Compute Engine 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/datastore/README.md b/packages/datastore/README.md index 45de4c2fe39..9e09143964b 100644 --- a/packages/datastore/README.md +++ b/packages/datastore/README.md @@ -93,8 +93,8 @@ 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 Cloud Datastore 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/dns/README.md b/packages/dns/README.md index 8ee4b2cd22d..b819ea3fd13 100644 --- a/packages/dns/README.md +++ b/packages/dns/README.md @@ -76,8 +76,8 @@ 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 Cloud DNS 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/language/README.md b/packages/language/README.md index 90b6763ebda..da7d35ddc5f 100644 --- a/packages/language/README.md +++ b/packages/language/README.md @@ -101,8 +101,8 @@ 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 Cloud Natural Language 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/logging/README.md b/packages/logging/README.md index 4757b2b0d4e..2a937c0bbf8 100644 --- a/packages/logging/README.md +++ b/packages/logging/README.md @@ -90,8 +90,8 @@ 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): * Stackdriver Logging 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/monitoring/README.md b/packages/monitoring/README.md index 1f4af9006ee..36bb4f93cae 100644 --- a/packages/monitoring/README.md +++ b/packages/monitoring/README.md @@ -49,8 +49,8 @@ If you are not running this client on Google Compute Engine, you need a Google D 1. Visit the [Google Developers Console][dev-console]. 2. Create a new project or click on an existing project. 3. 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/prediction/README.md b/packages/prediction/README.md index 0d95f2dc8cc..878b95e9c93 100644 --- a/packages/prediction/README.md +++ b/packages/prediction/README.md @@ -86,8 +86,8 @@ 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): * Prediction 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/pubsub/README.md b/packages/pubsub/README.md index b8d8ca252ec..f61b991eb52 100644 --- a/packages/pubsub/README.md +++ b/packages/pubsub/README.md @@ -79,8 +79,8 @@ 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 Cloud Pub/Sub 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/resource/README.md b/packages/resource/README.md index ce7acc8b11c..a22834e4d3b 100644 --- a/packages/resource/README.md +++ b/packages/resource/README.md @@ -72,8 +72,8 @@ 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 Cloud Resource Manager 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/speech/README.md b/packages/speech/README.md index 8f47b7efec7..f5816159d02 100644 --- a/packages/speech/README.md +++ b/packages/speech/README.md @@ -102,8 +102,8 @@ 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 Cloud Speech 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/storage/README.md b/packages/storage/README.md index 08fb071cfbb..89f4988cd21 100644 --- a/packages/storage/README.md +++ b/packages/storage/README.md @@ -90,8 +90,8 @@ If you are not running this client on Google Compute Engine, you need a Google D * Google Cloud Storage * Google Cloud Storage JSON 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. ``` js var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' diff --git a/packages/translate/README.md b/packages/translate/README.md index 04c94742fe7..62eae7cc405 100644 --- a/packages/translate/README.md +++ b/packages/translate/README.md @@ -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' @@ -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!