Node.js utilities to manage Rocket.Chat instances and drive integrations
See the README in each package path for further usage instructions.
Communicate with Rocket.Chat Realtime API via websocket (DDP).
🛏️ Rocket Rest
Simple helpers for calling Rocket.Chat REST API endpoints.
👨🎤 Rocket Sims
Populate Rocket.Chat with mock users and messages for testing.
Consume Rocket.Chat message streams and automate method calls.
CLI to manage and provision Rocket.Chat instances and databases.
See examples that combine usage of these packages. After you've read through the config and have a Rocket.Chat instance to test with, you can run the examples from source, for example:
yarn ts-node packages/examples/src/bot-mentions
Environment settings for instance and credentials to log in to Rocket.Chat. Required by all packages:
Env var | Description |
---|---|
RC_URL |
URL of the Rocket.Chat to connect to |
RC_SSL |
Force connection to use SSL (default false) |
RC_USERNAME |
Username for account login |
RC_PASSWORD |
Password for account login |
RC_AUTH |
Set to 'ldap' to enable LDAP login |
The default URL is localhost:3000
and username admin
password pass
.
These can also be set via .env
file or added to package.json in an rcConfig
attribute, using camelCase for property names instead of ENV_FORMAT.
See the @amazebot/config
README for more info on defining configs.
Lerna is used to link and publish packages that depend on each other, to streamline local development. All packages are written in Typescript and follow Standard JS style, with a minimum of 80% test coverage.
If you'd like to contribute, our priority is ensuring stability with new Rocket.Chat releases and communicating any known incompatibility with prior versions. We welcome enhancements to CI to test against an array of RC version containers - ideally with some persistent visibility for the community.
Testing Rocket.Chat
Clone and run a clean Rocket.Chat install in a different path, to make it available for unit tests.
- Clone
git clone https://github.com/RocketChat/Rocket.Chat.git rocketchat-test
- Enter
cd rocketchat-test
- Install
meteor npm install
- Run
export MONGO_URL='mongodb://localhost:27017/rocketchat-test'; meteor
You can use the startup wizard to create the admin user, but if you're installing often it's recommended to add the following environment configs to your bash profile, for Rocket.Chat to pick up on first install:
export ADMIN_USERNAME="admin"
export ADMIN_PASS="pass"
export LOG_LEVEL=debug
export TEST_MODE=true
export OVERWRITE_SETTING_Show_Setup_Wizard=completed
- Add CircleCI
- Add CodeCov
- Add Greenkeeper
A note about the Rocket.Chat JS SDK. This suite reproduces some features of the official SDK (it was made by the same person) but the SDK is evolving under direction of the core team for a wider variety of use cases. These packages are aimed at providing simple low level pieces in isolation for bespoke usage.