diff --git a/auth/auth.js b/auth/auth.js index 343e6caa00..c048cd2797 100644 --- a/auth/auth.js +++ b/auth/auth.js @@ -23,7 +23,7 @@ function authCloudImplicit () { // [START auth_cloud_implicit] // Imports the Google Cloud client library. - const Storage = require('@google-cloud/storage'); + const {Storage} = require('@google-cloud/storage'); // Instantiates a client. If you don't specify credentials when constructing // the client, the client library will look for credentials in the @@ -50,12 +50,13 @@ function authCloudImplicit () { function authCloudExplicit () { // [START auth_cloud_explicit] // Imports the Google Cloud client library. - const Storage = require('@google-cloud/storage'); + const {Storage} = require('@google-cloud/storage'); // Instantiates a client. Explicitly use service account credentials by // specifying the private key file. All clients in google-cloud-node have this // helper, see https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/docs/authentication.md const storage = new Storage({ + projectId: 'project-id', keyFilename: '/path/to/keyfile.json' }); diff --git a/auth/package.json b/auth/package.json index de6732ce1a..77b252bcf6 100644 --- a/auth/package.json +++ b/auth/package.json @@ -17,7 +17,7 @@ "test": "repo-tools test run --cmd ava -- -T 20s --verbose system-test/*.test.js" }, "dependencies": { - "@google-cloud/storage": "1.6.0", + "@google-cloud/storage": "^2.0.3", "yargs": "11.0.0" }, "devDependencies": {