1.0.1 • Published 7 years ago

@labzone/rocketchat-node v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
7 years ago

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
1.0.1

7 years ago

1.0.0

7 years ago