@@ -9,26 +9,26 @@ Javascript library to access the Zulip API
9
9
### With API Key
10
10
11
11
``` js
12
- const zulip = require (' zulip-js' );
12
+ const zulipInit = require (' zulip-js' );
13
13
const config = {
14
14
username: process .env .ZULIP_USERNAME ,
15
15
apiKey: process .env .ZULIP_API_KEY ,
16
16
realm: process .env .ZULIP_REALM ,
17
17
};
18
18
19
19
(async () => {
20
- const zulip = await zulip (config);
20
+ const zulip = await zulipInit (config);
21
21
// The zulip object now initialized with config
22
22
console .log (await zulip .streams .subscriptions .retrieve ());
23
23
})();
24
24
```
25
25
26
26
### With Username & Password
27
27
28
- You will need to first retrieve the API key by calling ` await zulip (config) ` .
28
+ You will need to first retrieve the API key by calling ` await zulipInit (config) ` .
29
29
30
30
``` js
31
- const zulip = require (' zulip-js' );
31
+ const zulipInit = require (' zulip-js' );
32
32
const config = {
33
33
username: process .env .ZULIP_USERNAME ,
34
34
password: process .env .ZULIP_PASSWORD ,
@@ -37,7 +37,7 @@ const config = {
37
37
38
38
(async () => {
39
39
// Fetch API Key
40
- const zulip = await zulip (config);
40
+ const zulip = await zulipInit (config);
41
41
// The zulip object now contains the API Key
42
42
console .log (await zulip .streams .subscriptions .retrieve ());
43
43
})();
@@ -54,14 +54,14 @@ key=wlueAg7cQXqKpUgIaPP3dmF4vibZXal7
54
54
site=http://localhost:9991
55
55
```
56
56
57
- Please remember to add this file to your ` .gitignore ` ! Calling ` await zulip ({ zuliprc: 'zuliprc' }) ` will read this file.
57
+ Please remember to add this file to your ` .gitignore ` ! Calling ` await zulipInit ({ zuliprc: 'zuliprc' }) ` will read this file.
58
58
59
59
``` js
60
- const zulip = require (' zulip-js' );
60
+ const zulipInit = require (' zulip-js' );
61
61
const path = require (' path' );
62
62
const zuliprc = path .resolve (__dirname , ' zuliprc' );
63
63
(async () => {
64
- const zulip = await zulip ({ zuliprc });
64
+ const zulip = await zulipInit ({ zuliprc });
65
65
// The zulip object now contains the config from the zuliprc file
66
66
console .log (await zulip .streams .subscriptions .retrieve ());
67
67
})();
0 commit comments