Functions to call the Rocket.Chat API
Last updated 2 years ago by jschirrmacher .
MIT · Original npm · Tarball · package.json
$ cnpm install rc-api 
SYNC missed versions from official npm registry.

A Library to access the Rocket.Chat API via functions.


npm i -S rc-api


If you, for example, want to assign the pin-message permission to the user role, you can do the following:

const RCApi = require('rc-api');
const api = new RCApi({logger: console, dryRun: false});

    client: {
        url: 'https://my-chat.example.com',
        username: 'admin-user',
        passw: 'my-secret-password'
    permission: 'pin-message',
    role: 'user'

The client object, which is given to the API functions, will be modified to contain the access token after the first call which is used in later calls as well. So it is a good idea to re-use the same object, if you do more than one API call.

Options to rc-api constructor

  • logger - the logger you want to use. Defaults to console
  • dryRun - if set true, all API calls are replaced by GET methods

Which API paths are supported?

Currently only those Rocket.Chat API paths are covered, that we needed for our use case, but we would be pleased to receive your PR, if you want to enhance this library. For now, RTFS to know which paths are supported :-)

Current Tags

  • 2.0.0                                ...           latest (2 years ago)

2 Versions

  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (3)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |