@@ -98,7 +98,12 @@ With `google-cloud` it's incredibly easy to get authenticated and start using Go
98
98
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.
99
99
100
100
``` js
101
+ var storage = require (' @google-cloud/storage' )();
102
+
103
+ // If you're using the google-cloud meta-package:
101
104
var gcloud = require (' google-cloud' );
105
+ var storage = gcloud .storage ();
106
+
102
107
// ...you're good to go! See the next section to get started using the APIs.
103
108
```
104
109
@@ -172,12 +177,13 @@ $ npm install --save @google-cloud/datastore
172
177
var datastore = require (' @google-cloud/datastore' );
173
178
```
174
179
180
+ #### Authentication
181
+
182
+ See [ Authentication] ( #authentication ) .
183
+
175
184
#### Preview
176
185
177
186
``` 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
-
181
187
var datastoreClient = datastore ({
182
188
projectId: ' grape-spaceship-123' ,
183
189
keyFilename: ' /path/to/keyfile.json'
@@ -233,14 +239,15 @@ $ npm install --save @google-cloud/storage
233
239
var storage = require (' @google-cloud/storage' );
234
240
```
235
241
242
+ #### Authentication
243
+
244
+ See [ Authentication] ( #authentication ) .
245
+
236
246
#### Preview
237
247
238
248
``` js
239
249
var fs = require (' fs' );
240
250
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
-
244
251
var gcs = storage ({
245
252
projectId: ' grape-spaceship-123' ,
246
253
keyFilename: ' /path/to/keyfile.json'
@@ -294,12 +301,13 @@ $ npm install --save @google-cloud/translate
294
301
var translate = require (' @google-cloud/translate' );
295
302
```
296
303
304
+ #### Authentication
305
+
306
+ See [ Authentication] ( #authentication ) .
307
+
297
308
#### Preview
298
309
299
310
``` 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
-
303
311
var translateClient = translate ({
304
312
projectId: ' grape-spaceship-123' ,
305
313
keyFilename: ' /path/to/keyfile.json'
@@ -352,12 +360,13 @@ $ npm install --save @google-cloud/logging
352
360
var logging = require (' @google-cloud/logging' );
353
361
```
354
362
363
+ #### Authentication
364
+
365
+ See [ Authentication] ( #authentication ) .
366
+
355
367
#### Preview
356
368
357
369
``` js
358
- // Authenticating on a global-basis. You can also authenticate on a per-API-
359
- // basis (see Authentication section above).
360
-
361
370
var loggingClient = logging ({
362
371
projectId: ' grape-spaceship-123' ,
363
372
keyFilename: ' /path/to/keyfile.json'
@@ -413,12 +422,13 @@ $ npm install --save @google-cloud/language
413
422
var language = require (' @google-cloud/language' );
414
423
```
415
424
425
+ #### Authentication
426
+
427
+ See [ Authentication] ( #authentication ) .
428
+
416
429
#### Preview
417
430
418
431
``` 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
-
422
432
var languageClient = language ({
423
433
projectId: ' grape-spaceship-123' ,
424
434
keyFilename: ' /path/to/keyfile.json'
@@ -455,12 +465,13 @@ $ npm install --save @google-cloud/spanner
455
465
var spanner = require (' @google-cloud/spanner' );
456
466
```
457
467
468
+ #### Authentication
469
+
470
+ See [ Authentication] ( #authentication ) .
471
+
458
472
#### Preview
459
473
460
474
``` 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
-
464
475
var spannerClient = spanner ({
465
476
projectId: ' grape-spaceship-123' ,
466
477
keyFilename: ' /path/to/keyfile.json'
@@ -536,12 +547,13 @@ $ npm install --save @google-cloud/vision
536
547
var vision = require (' @google-cloud/vision' );
537
548
```
538
549
550
+ #### Authentication
551
+
552
+ See [ Authentication] ( #authentication ) .
553
+
539
554
#### Preview
540
555
541
556
``` 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
-
545
557
var visionClient = vision ({
546
558
projectId: ' grape-spaceship-123' ,
547
559
keyFilename: ' /path/to/keyfile.json'
@@ -590,12 +602,13 @@ $ npm install --save @google-cloud/bigquery
590
602
var bigquery = require (' @google-cloud/bigquery' );
591
603
```
592
604
605
+ #### Authentication
606
+
607
+ See [ Authentication] ( #authentication ) .
608
+
593
609
#### Preview
594
610
595
611
``` 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
-
599
612
var bigqueryClient = bigquery ({
600
613
projectId: ' grape-spaceship-123' ,
601
614
keyFilename: ' /path/to/keyfile.json'
@@ -640,6 +653,10 @@ $ npm install --save @google-cloud/monitoring
640
653
var monitoring = require (' @google-cloud/monitoring' );
641
654
```
642
655
656
+ #### Authentication
657
+
658
+ See [ Authentication] ( #authentication ) .
659
+
643
660
#### Preview
644
661
645
662
``` js
@@ -706,12 +723,13 @@ $ npm install --save @google-cloud/bigtable
706
723
var bigtable = require (' @google-cloud/bigtable' );
707
724
```
708
725
726
+ #### Authentication
727
+
728
+ See [ Authentication] ( #authentication ) .
729
+
709
730
#### Preview
710
731
711
732
``` 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
-
715
733
var bigtableClient = bigtable ({
716
734
projectId: ' grape-spaceship-123' ,
717
735
keyFilename: ' /path/to/keyfile.json'
@@ -764,12 +782,13 @@ $ npm install --save @google-cloud/dns
764
782
var dns = require (' @google-cloud/dns' );
765
783
```
766
784
785
+ #### Authentication
786
+
787
+ See [ Authentication] ( #authentication ) .
788
+
767
789
#### Preview
768
790
769
791
``` 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
-
773
792
var dnsClient = dns ({
774
793
projectId: ' grape-spaceship-123' ,
775
794
keyFilename: ' /path/to/keyfile.json'
@@ -812,12 +831,13 @@ $ npm install --save @google-cloud/pubsub
812
831
var pubsub = require (' @google-cloud/pubsub' );
813
832
```
814
833
834
+ #### Authentication
835
+
836
+ See [ Authentication] ( #authentication ) .
837
+
815
838
#### Preview
816
839
817
840
``` 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
-
821
841
var pubsubClient = pubsub ({
822
842
projectId: ' grape-spaceship-123' ,
823
843
keyFilename: ' /path/to/keyfile.json'
@@ -859,12 +879,13 @@ $ npm install --save @google-cloud/resource
859
879
var resource = require (' @google-cloud/resource' );
860
880
```
861
881
882
+ #### Authentication
883
+
884
+ See [ Authentication] ( #authentication ) .
885
+
862
886
#### Preview
863
887
864
888
``` 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
-
868
889
var resourceClient = resource ({
869
890
projectId: ' grape-spaceship-123' ,
870
891
keyFilename: ' /path/to/keyfile.json'
@@ -901,12 +922,13 @@ $ npm install --save @google-cloud/speech
901
922
var speech = require (' @google-cloud/speech' );
902
923
```
903
924
925
+ #### Authentication
926
+
927
+ See [ Authentication] ( #authentication ) .
928
+
904
929
#### Preview
905
930
906
931
``` 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
-
910
932
var speechClient = speech ({
911
933
projectId: ' my-project' ,
912
934
keyFilename: ' /path/to/keyfile.json'
@@ -953,12 +975,13 @@ $ npm install --save @google-cloud/compute
953
975
var compute = require (' @google-cloud/compute' );
954
976
```
955
977
978
+ #### Authentication
979
+
980
+ See [ Authentication] ( #authentication ) .
981
+
956
982
#### Preview
957
983
958
984
``` 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
-
962
985
var gce = compute ({
963
986
projectId: ' grape-spaceship-123' ,
964
987
keyFilename: ' /path/to/keyfile.json'
@@ -996,12 +1019,13 @@ $ npm install --save @google-cloud/prediction
996
1019
var prediction = require (' @google-cloud/prediction' );
997
1020
```
998
1021
1022
+ #### Authentication
1023
+
1024
+ See [ Authentication] ( #authentication ) .
1025
+
999
1026
#### Preview
1000
1027
1001
1028
``` 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
-
1005
1029
var predictionClient = prediction ({
1006
1030
projectId: ' grape-spaceship-123' ,
1007
1031
keyFilename: ' /path/to/keyfile.json'
@@ -1077,6 +1101,10 @@ The module provides automatic [uncaught exception handling][stackdriver-errors-u
1077
1101
var errors = require (' @google-cloud/error-reporting' )();
1078
1102
```
1079
1103
1104
+ #### Authentication
1105
+
1106
+ See [ Authentication] ( #authentication ) .
1107
+
1080
1108
#### Preview
1081
1109
1082
1110
``` js
0 commit comments