chatty-pub/node_modules/zulip-js/examples/streams.js
كارل مبارك 374620645c initial commit
2021-06-26 13:12:56 +02:00

21 lines
494 B
JavaScript

const zulip = require('../lib');
const config = {
username: process.env.ZULIP_USERNAME,
apiKey: process.env.ZULIP_API_KEY,
realm: process.env.ZULIP_REALM,
};
(async () => {
const z = await zulip(config);
// Fetch all streams
console.log(await z.streams.retrieve());
// Fetch user's subscriptions
console.log(await z.streams.subscriptions.retrieve());
// Get all the topics in the stream with ID 15
console.log(await z.streams.topics.retrieve({ stream_id: 15 }));
})();