npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@alexwoo-awso/openclaw-rocketchat

v0.1.0

Published

OpenClaw Rocket.Chat channel plugin

Downloads

113

Readme

OpenClaw Rocket.Chat Plugin

Channel plugin for connecting OpenClaw to Rocket.Chat instances.

npm package: @alexwoo-awso/openclaw-rocketchat

Features

  • Direct messages, channels, groups, and thread support
  • Media/file upload and download
  • Mention detection and configurable chat modes
  • Multi-account support
  • Pairing-based access control
  • Block streaming with coalescing
  • WebSocket (DDP) realtime message monitoring with auto-reconnect

Setup

Secret storage (recommended)

Prefer environment variables for secrets (token/password) rather than committing them into openclaw.json.

OpenClaw loads env vars from:

  • the Gateway process environment (systemd/launchd/etc), and
  • ~/.openclaw/.env as a standard global fallback.

See: OpenClaw docs “Environment variables”.

1. Authentication

The plugin supports two authentication methods:

Method A: Personal Access Token (recommended for plans that support it)

  1. Go to My Account → Personal Access Tokens in your Rocket.Chat instance
  2. Create a new token — note both the Token and your User ID

Note: Personal Access Tokens may not be available on all Rocket.Chat plans (e.g., Starter).

Method B: Username/Password Login (works on all plans)

If PAT is not available, use username/password. The plugin will call /api/v1/login to obtain a session token automatically.

2. Configure OpenClaw

Environment variables (default account)

Set these on the gateway host (for systemd/launchd installs you can put them in ~/.openclaw/.env):

  • ROCKETCHAT_URL=https://chat.example.com
  • ROCKETCHAT_AUTH_TOKEN=...
  • ROCKETCHAT_USER_ID=...

If you use login auth instead of a Personal Access Token:

  • ROCKETCHAT_USERNAME=...
  • ROCKETCHAT_PASSWORD=...

Env vars apply only to the default account. Other accounts must use config values under channels.rocketchat.accounts.

Option A: Environment Variables (PAT)

export ROCKETCHAT_URL=https://chat.example.com
export ROCKETCHAT_AUTH_TOKEN=your-personal-access-token
export ROCKETCHAT_USER_ID=your-user-id

Option B: Environment Variables (Username/Password)

export ROCKETCHAT_URL=https://chat.example.com
export ROCKETCHAT_USERNAME=openclaw
export ROCKETCHAT_PASSWORD=your-password

Option C: Config File (PAT)

{
  "channels": {
    "rocketchat": {
      "enabled": true,
      "baseUrl": "https://chat.example.com",
      "authToken": "your-personal-access-token",
      "userId": "your-user-id",
      "dmPolicy": "open",
      "allowFrom": ["*"]
    }
  }
}

Option D: Config File (Username/Password)

{
  "channels": {
    "rocketchat": {
      "enabled": true,
      "baseUrl": "https://chat.example.com",
      "username": "openclaw",
      "password": "your-password",
      "dmPolicy": "open",
      "allowFrom": ["*"]
    }
  }
}

3. Multi-Account Setup

channels:
  rocketchat:
    enabled: true
    accounts:
      primary:
        baseUrl: https://chat.example.com
        authToken: token1
        userId: uid1
        allowFrom: ["@admin"]
      secondary:
        baseUrl: https://other-server.com
        authToken: token2
        userId: uid2
        allowFrom: ["@user"]

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | baseUrl | string | — | Rocket.Chat server URL | | authToken | string | — | Personal access token | | userId | string | — | Bot user's ID | | username | string | — | Username for login auth (alternative to PAT) | | password | string | — | Password for login auth (alternative to PAT) | | dmPolicy | string | "pairing" | pairing, allowlist, open, disabled | | allowFrom | array | [] | Allowed user IDs or @usernames for DMs | | groupPolicy | string | "allowlist" | allowlist, open, disabled | | groupAllowFrom | array | [] | Allowed senders in groups/channels | | chatmode | string | — | oncall, onmessage, onchar | | requireMention | boolean | true | Require @mention in channels | | textChunkLimit | number | 4000 | Max chars per outbound message | | blockStreaming | boolean | — | Enable/disable block streaming |

Sending Messages

# Send to a channel
openclaw send --channel rocketchat --to channel:ROOM_ID "Hello!"

# Send to a user
openclaw send --channel rocketchat --to @username "Hello!"
openclaw send --channel rocketchat --to user:USER_ID "Hello!"

Architecture

  • DDP WebSocket for realtime message reception (stream-room-messages)
  • REST API for sending messages, file uploads, user/room info
  • Authentication via X-Auth-Token + X-User-Id headers
  • Room types: c (channel), p (private group), d (direct), l (livechat)

Troubleshooting

  • No replies in channels: ensure the bot is in the channel and mention it (oncall), use a trigger prefix (onchar), or set chatmode: "onmessage".
  • Auth/token issues:
    • Preferred (recommended): use a Rocket.Chat Personal Access Token (PAT) (ROCKETCHAT_AUTH_TOKEN + ROCKETCHAT_USER_ID). PATs are typically long-lived until revoked.
    • Alternative: configure ROCKETCHAT_USERNAME + ROCKETCHAT_PASSWORD. The plugin logs in via /api/v1/login and will re-login automatically if the session token expires.
    • If you manually generated a login session token and pasted it into config without also providing username/password, that token may expire based on your Rocket.Chat server settings (often ~90 days). In that case prefer PAT or store username/password so the plugin can refresh automatically.
  • Multi-account issues: env vars only apply to the default account.

License

MIT