Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

J3-Tech/rocketchat-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RocketChat NodeJs Library

Check RocketChat REST API

Examples

Authentication, list users and post new message


var rocketchat  =  require('./bin/rocketchat.bundle.js').RocketChat;

var client = new rocketchat.Client();
client.hostname = 'localhost';

var auth = new rocketchat.Authentication(client);
auth.login({
  username: 'bot',
 	password: 'mypass'
}).then(() =>  {
  auth.me().then(({data})=> {
    console.log(data)
  });
  var user = new rocketchat.Users(client);
  user.list().then(({data}) => {
    console.log(data);
  });
  var chat = new rocketchat.Chat(client);
  chat.postMessage({
    roomId: 'general',
    channel: '#general',
    text: 'testing from my new lib',

  });
});

Todo

  • Add good documentation
  • add missing implementation