mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 23:43:43 +00:00
api/register-queue: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API credentials in a config object.
This commit is contained in:
@@ -60,21 +60,17 @@ More examples and documentation can be found [here](https://github.com/zulip/zul
|
|||||||
```js
|
```js
|
||||||
const zulip = require('zulip-js');
|
const zulip = require('zulip-js');
|
||||||
|
|
||||||
|
// Download zuliprc-dev from your dev server
|
||||||
const config = {
|
const config = {
|
||||||
username: 'othello-bot@example.com',
|
zuliprc: 'zuliprc-dev',
|
||||||
apiKey: 'a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5',
|
|
||||||
realm: '{{ api_url }}'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const client = zulip(config);
|
zulip(config).then((client) => {
|
||||||
|
|
||||||
// Register a queue
|
// Register a queue
|
||||||
const params = {
|
const params = {
|
||||||
event_types: ['message']
|
event_types: ['message']
|
||||||
};
|
};
|
||||||
|
client.queues.register(params).then(console.log);
|
||||||
client.queues.register(params).then(res => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user