Skip to main content
Channel plugins integrate messaging platforms with OpenClaw. A channel plugin implements adapters for message handling, authentication, status checks, and more.

Channel Structure

A channel plugin implements the ChannelPlugin interface:

Registering Channels

Register channels via the Plugin API:

Core Adapters

Config Adapter

The config adapter manages channel configuration and accounts:

Gateway Adapter

The gateway adapter handles incoming messages:

Outbound Adapter

The outbound adapter sends messages:

Status Adapter

The status adapter provides connection status:

Advanced Adapters

Authentication Adapter

Handle login flows:

Pairing Adapter

Manage device pairing:

Groups Adapter

Manage group chats:

Mentions Adapter

Handle @mentions in groups:

Directory Adapter

List users and groups:

Example: Matrix Channel Plugin

The Matrix channel plugin demonstrates a complete implementation:
See the full source for details.

Message Handling

Channel plugins handle inbound messages by dispatching to the routing system:

Outbound Message Types

Handle different payload types:

Configuration Schema

Define configuration with Zod:

Runtime Services

Channel plugins can use runtime services:
Then use in channel code:

Best Practices

1. Error Handling

Handle connection errors gracefully:

2. Reconnection Logic

Implement automatic reconnection:

3. Rate Limiting

Respect platform rate limits:

4. Status Checks

Provide detailed status information:

Example Channels

Explore these built-in channel plugins:
  • Matrix - extensions/matrix - Matrix protocol integration
  • Microsoft Teams - extensions/msteams - Bot Framework integration
  • IRC - extensions/irc - IRC protocol
  • Mattermost - extensions/mattermost - Mattermost API
  • Nextcloud Talk - extensions/nextcloud-talk - Nextcloud integration
See the extensions directory for complete implementations.

Next Steps