File tree 2 files changed +13
-24
lines changed
packages/google-cloud-oslogin
2 files changed +13
-24
lines changed Original file line number Diff line number Diff line change @@ -55,29 +55,18 @@ npm install @google-cloud/os-login
55
55
### Using the client library
56
56
57
57
``` javascript
58
- if (
59
- ! process .env .GCLOUD_PROJECT ||
60
- ! process .env .GOOGLE_APPLICATION_CREDENTIALS
61
- ) {
62
- throw new Error (
63
- ' Usage: GCLOUD_PROJECT=<project_id> GOOGLE_APPLICATION_CREDENTIALS=<path to key json file> node #{$0}'
64
- );
58
+ const {OsLoginServiceClient } = require (' @google-cloud/os-login' );
59
+ const client = new OsLoginServiceClient ();
60
+
61
+ async function quickstart () {
62
+ const [loginProfile ] = await client .getLoginProfile ({
63
+
64
+ });
65
+ console .log (' Login Profile:' );
66
+ console .log (loginProfile);
65
67
}
66
68
67
- const oslogin = require (' @google-cloud/os-login' );
68
-
69
- const projectId = process .env .GCLOUD_PROJECT ;
70
-
71
- const client = new oslogin.OsLoginServiceClient ({
72
- projectId: projectId,
73
- });
74
-
75
- const request = {
76
- name: ' users/1234abcd' ,
77
- };
78
-
79
- const [loginProfile ] = await client .getLoginProfile (request);
80
- console .log (loginProfile);
69
+ quickstart ();
81
70
82
71
```
83
72
Original file line number Diff line number Diff line change 1
1
{
2
- "updateTime": "2019-04-24T18:14:09.570889Z ",
2
+ "updateTime": "2019-04-25T11:36:51.762325Z ",
3
3
"sources": [
4
4
{
5
5
"generator": {
12
12
"git": {
13
13
"name": "googleapis",
14
14
"remote": "https://github.com/googleapis/googleapis.git",
15
- "sha": "45199a22a4e47c8d53213d1ac4a5ad7f22382c56 ",
16
- "internalRef": "244925894 "
15
+ "sha": "25cbfd4a5386742f5968d69bd276a0436d23bd97 ",
16
+ "internalRef": "245137805 "
17
17
}
18
18
},
19
19
{
You can’t perform that action at this time.
0 commit comments