Skip to content

Commit f243e26

Browse files
readme: link to auth info above samples (#2543)
1 parent a20e1da commit f243e26

File tree

1 file changed

+73
-45
lines changed

1 file changed

+73
-45
lines changed

README.md

Lines changed: 73 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ With `google-cloud` it's incredibly easy to get authenticated and start using Go
9898
If you are running this client on Google Cloud Platform, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.
9999

100100
``` js
101+
var storage = require('@google-cloud/storage')();
102+
103+
// If you're using the google-cloud meta-package:
101104
var gcloud = require('google-cloud');
105+
var storage = gcloud.storage();
106+
102107
// ...you're good to go! See the next section to get started using the APIs.
103108
```
104109

@@ -172,12 +177,13 @@ $ npm install --save @google-cloud/datastore
172177
var datastore = require('@google-cloud/datastore');
173178
```
174179

180+
#### Authentication
181+
182+
See [Authentication](#authentication).
183+
175184
#### Preview
176185

177186
```js
178-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
179-
// global basis (see Authentication section above).
180-
181187
var datastoreClient = datastore({
182188
projectId: 'grape-spaceship-123',
183189
keyFilename: '/path/to/keyfile.json'
@@ -233,14 +239,15 @@ $ npm install --save @google-cloud/storage
233239
var storage = require('@google-cloud/storage');
234240
```
235241

242+
#### Authentication
243+
244+
See [Authentication](#authentication).
245+
236246
#### Preview
237247

238248
```js
239249
var fs = require('fs');
240250

241-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
242-
// global basis (see Authentication section above).
243-
244251
var gcs = storage({
245252
projectId: 'grape-spaceship-123',
246253
keyFilename: '/path/to/keyfile.json'
@@ -294,12 +301,13 @@ $ npm install --save @google-cloud/translate
294301
var translate = require('@google-cloud/translate');
295302
```
296303

304+
#### Authentication
305+
306+
See [Authentication](#authentication).
307+
297308
#### Preview
298309

299310
```js
300-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
301-
// global basis (see Authentication section above).
302-
303311
var translateClient = translate({
304312
projectId: 'grape-spaceship-123',
305313
keyFilename: '/path/to/keyfile.json'
@@ -352,12 +360,13 @@ $ npm install --save @google-cloud/logging
352360
var logging = require('@google-cloud/logging');
353361
```
354362

363+
#### Authentication
364+
365+
See [Authentication](#authentication).
366+
355367
#### Preview
356368

357369
```js
358-
// Authenticating on a global-basis. You can also authenticate on a per-API-
359-
// basis (see Authentication section above).
360-
361370
var loggingClient = logging({
362371
projectId: 'grape-spaceship-123',
363372
keyFilename: '/path/to/keyfile.json'
@@ -413,12 +422,13 @@ $ npm install --save @google-cloud/language
413422
var language = require('@google-cloud/language');
414423
```
415424

425+
#### Authentication
426+
427+
See [Authentication](#authentication).
428+
416429
#### Preview
417430

418431
```js
419-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
420-
// global basis (see Authorization section above).
421-
422432
var languageClient = language({
423433
projectId: 'grape-spaceship-123',
424434
keyFilename: '/path/to/keyfile.json'
@@ -455,12 +465,13 @@ $ npm install --save @google-cloud/spanner
455465
var spanner = require('@google-cloud/spanner');
456466
```
457467

468+
#### Authentication
469+
470+
See [Authentication](#authentication).
471+
458472
#### Preview
459473

460474
```js
461-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
462-
// global basis (see Authentication section above).
463-
464475
var spannerClient = spanner({
465476
projectId: 'grape-spaceship-123',
466477
keyFilename: '/path/to/keyfile.json'
@@ -536,12 +547,13 @@ $ npm install --save @google-cloud/vision
536547
var vision = require('@google-cloud/vision');
537548
```
538549

550+
#### Authentication
551+
552+
See [Authentication](#authentication).
553+
539554
#### Preview
540555

541556
```js
542-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
543-
// global basis (see Authentication section above).
544-
545557
var visionClient = vision({
546558
projectId: 'grape-spaceship-123',
547559
keyFilename: '/path/to/keyfile.json'
@@ -590,12 +602,13 @@ $ npm install --save @google-cloud/bigquery
590602
var bigquery = require('@google-cloud/bigquery');
591603
```
592604

605+
#### Authentication
606+
607+
See [Authentication](#authentication).
608+
593609
#### Preview
594610

595611
```js
596-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
597-
// global basis (see Authentication section above).
598-
599612
var bigqueryClient = bigquery({
600613
projectId: 'grape-spaceship-123',
601614
keyFilename: '/path/to/keyfile.json'
@@ -640,6 +653,10 @@ $ npm install --save @google-cloud/monitoring
640653
var monitoring = require('@google-cloud/monitoring');
641654
```
642655

656+
#### Authentication
657+
658+
See [Authentication](#authentication).
659+
643660
#### Preview
644661

645662
```js
@@ -706,12 +723,13 @@ $ npm install --save @google-cloud/bigtable
706723
var bigtable = require('@google-cloud/bigtable');
707724
```
708725

726+
#### Authentication
727+
728+
See [Authentication](#authentication).
729+
709730
#### Preview
710731

711732
```js
712-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
713-
// global basis (see Authentication section above).
714-
715733
var bigtableClient = bigtable({
716734
projectId: 'grape-spaceship-123',
717735
keyFilename: '/path/to/keyfile.json'
@@ -764,12 +782,13 @@ $ npm install --save @google-cloud/dns
764782
var dns = require('@google-cloud/dns');
765783
```
766784

785+
#### Authentication
786+
787+
See [Authentication](#authentication).
788+
767789
#### Preview
768790

769791
```js
770-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
771-
// global basis (see Authentication section above).
772-
773792
var dnsClient = dns({
774793
projectId: 'grape-spaceship-123',
775794
keyFilename: '/path/to/keyfile.json'
@@ -812,12 +831,13 @@ $ npm install --save @google-cloud/pubsub
812831
var pubsub = require('@google-cloud/pubsub');
813832
```
814833

834+
#### Authentication
835+
836+
See [Authentication](#authentication).
837+
815838
#### Preview
816839

817840
```js
818-
// Authenticating on a per-API-basis. You don't need to do this if you
819-
// auth on a global basis (see Authentication section above).
820-
821841
var pubsubClient = pubsub({
822842
projectId: 'grape-spaceship-123',
823843
keyFilename: '/path/to/keyfile.json'
@@ -859,12 +879,13 @@ $ npm install --save @google-cloud/resource
859879
var resource = require('@google-cloud/resource');
860880
```
861881

882+
#### Authentication
883+
884+
See [Authentication](#authentication).
885+
862886
#### Preview
863887

864888
```js
865-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
866-
// global basis (see Authentication section above).
867-
868889
var resourceClient = resource({
869890
projectId: 'grape-spaceship-123',
870891
keyFilename: '/path/to/keyfile.json'
@@ -901,12 +922,13 @@ $ npm install --save @google-cloud/speech
901922
var speech = require('@google-cloud/speech');
902923
```
903924

925+
#### Authentication
926+
927+
See [Authentication](#authentication).
928+
904929
#### Preview
905930

906931
```js
907-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
908-
// global basis (see Authentication section above).
909-
910932
var speechClient = speech({
911933
projectId: 'my-project',
912934
keyFilename: '/path/to/keyfile.json'
@@ -953,12 +975,13 @@ $ npm install --save @google-cloud/compute
953975
var compute = require('@google-cloud/compute');
954976
```
955977

978+
#### Authentication
979+
980+
See [Authentication](#authentication).
981+
956982
#### Preview
957983

958984
```js
959-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
960-
// global basis (see Authentication section above).
961-
962985
var gce = compute({
963986
projectId: 'grape-spaceship-123',
964987
keyFilename: '/path/to/keyfile.json'
@@ -996,12 +1019,13 @@ $ npm install --save @google-cloud/prediction
9961019
var prediction = require('@google-cloud/prediction');
9971020
```
9981021

1022+
#### Authentication
1023+
1024+
See [Authentication](#authentication).
1025+
9991026
#### Preview
10001027

10011028
```js
1002-
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
1003-
// global basis (see Authentication section above).
1004-
10051029
var predictionClient = prediction({
10061030
projectId: 'grape-spaceship-123',
10071031
keyFilename: '/path/to/keyfile.json'
@@ -1077,6 +1101,10 @@ The module provides automatic [uncaught exception handling][stackdriver-errors-u
10771101
var errors = require('@google-cloud/error-reporting')();
10781102
```
10791103

1104+
#### Authentication
1105+
1106+
See [Authentication](#authentication).
1107+
10801108
#### Preview
10811109

10821110
```js

0 commit comments

Comments
 (0)