Skip to content

Commit b232e96

Browse files
authored
Update storage in auth sample (#750)
1 parent e8d83aa commit b232e96

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

auth/auth.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
function authCloudImplicit () {
2424
// [START auth_cloud_implicit]
2525
// Imports the Google Cloud client library.
26-
const Storage = require('@google-cloud/storage');
26+
const {Storage} = require('@google-cloud/storage');
2727

2828
// Instantiates a client. If you don't specify credentials when constructing
2929
// the client, the client library will look for credentials in the
@@ -50,12 +50,13 @@ function authCloudImplicit () {
5050
function authCloudExplicit () {
5151
// [START auth_cloud_explicit]
5252
// Imports the Google Cloud client library.
53-
const Storage = require('@google-cloud/storage');
53+
const {Storage} = require('@google-cloud/storage');
5454

5555
// Instantiates a client. Explicitly use service account credentials by
5656
// specifying the private key file. All clients in google-cloud-node have this
5757
// helper, see https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/docs/authentication.md
5858
const storage = new Storage({
59+
projectId: 'project-id',
5960
keyFilename: '/path/to/keyfile.json'
6061
});
6162

auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test": "repo-tools test run --cmd ava -- -T 20s --verbose system-test/*.test.js"
1818
},
1919
"dependencies": {
20-
"@google-cloud/storage": "1.6.0",
20+
"@google-cloud/storage": "^2.0.3",
2121
"yargs": "11.0.0"
2222
},
2323
"devDependencies": {

0 commit comments

Comments
 (0)