skip to content

Your team needs OpenClaw on a chat platform it does not support; what does a channel plugin's `openclaw.plugin.json` declare, and what does the plugin own?

level: middleimportance: nice to knowfreq 4%

answer

  1. metadata read before code runs
  2. id and configSchema are required
  3. the channels field marks ownership
  4. channelConfigs validates the channel block
  5. core keeps the shared message tool

basics

~20 s

A channel plugin's openclaw.plugin.json declares its id, a configSchema, the channel ids it owns under channels, and a channelConfigs schema for channels.<id>. The plugin owns accounts, DM policy, pairing, threading and outbound sends; core keeps the shared message tool.

solid answer

~40 s

OpenClaw reads `openclaw.plugin.json` before importing any plugin code, so it holds cheap metadata only. `id` and `configSchema` are required for every native plugin, and `configSchema` validates `plugins.entries.<id>.config`. A channel plugin adds `channels: ["orbit-chat"]`, which is what marks it as a channel owner (there is no `kind` for this), and `channelConfigs.orbit-chat.schema`, which validates the `channels.orbit-chat` block before the runtime loads. `package.json` points `openclaw.extensions` at the entry module, which calls `defineChannelPluginEntry`. The plugin then owns account resolution and setup, DM policy and allowlists, pairing, mapping platform conversation ids to sessions, threading and outbound delivery. Core owns the shared `message` tool, prompt wiring and dispatch, so the adapter does not implement send or react tools of its own.

code

json · 24 lines
json
{
  "id": "orbit-chat",
  "name": "Orbit Chat",
  "description": "Orbit Chat channel plugin",
  "channels": ["orbit-chat"],
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {}
  },
  "channelConfigs": {
    "orbit-chat": {
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "token": { "type": "string" },
          "allowFrom": { "type": "array", "items": { "type": "string" } }
        }
      },
      "uiHints": { "token": { "label": "Bot token", "sensitive": true } }
    }
  }
}

go deeper

for a junior

Recall that every native plugin needs openclaw.plugin.json with an id and a configSchema, and that a channel plugin lists its channel under channels.

for a middle

Explain the two schemas and the two config blocks they guard, the package.json entry wiring, and which duties sit in the adapter versus core.

for a senior

Point out that the adapter implements DM policy and pairing, so its bugs decide who reaches the agent, and know how ownership conflicts and preferOver resolve.

for a principal

Weigh building and maintaining a channel adapter against an experimental plugin API that moves every release: who owns upgrades, testing against betas and the access-control review.

## Why the manifest exists Every native OpenClaw plugin must ship `openclaw.plugin.json` in its plugin root. OpenClaw reads it **without executing plugin code**: to validate configuration, show setup and UI hints, plan activation and learn which channels, providers and tools the plugin owns. A missing or invalid manifest blocks config validation and is reported as a plugin error. Anything in it must be cheap to inspect; runtime behaviour belongs in the entry module. Many of OpenClaw's own messaging channels are built this way, as plugins that ship in the core package or install on demand, so a team adding a platform the product lacks writes the same kind of package. ## The fields a channel plugin needs | Field | Required | What it does | | --- | --- | --- | | `id` | yes | Canonical plugin id; the key under `plugins.entries.<id>` | | `configSchema` | yes | Inline JSON Schema for `plugins.entries.<id>.config`, even if empty | | `channels` | for channels | Channel ids this plugin owns; this, not a `kind` field, marks a channel plugin | | `channelConfigs.<id>.schema` | for channels | Validates the `channels.<id>` block before runtime loads | | `channelConfigs.<id>.uiHints` | no | Labels and `sensitive` flags for setup and the Control UI | | `name`, `description` | no | Human-readable identity | Two schemas, two config blocks: settings that belong to the plugin go under `plugins.entries.<id>.config`; the channel's account settings (a bot token, an allowlist of senders) go under `channels.<id>`. Strict schemas (`additionalProperties: false`, as bundled plugins use) reject a key placed in the wrong block before any code runs. ## The package and entry point - `package.json` carries an `openclaw` block: `extensions` points at the runtime entry (built JavaScript for a published package), and `channel` gives the id, label and blurb. - The entry module exports `defineChannelPluginEntry(...)` from the plugin SDK; non-channel plugins use `definePluginEntry` instead. - The plugin SDK is marked experimental, so pin the OpenClaw host version you test against through the package's compatibility metadata. ## What the plugin owns, and what core keeps The channel plugin is responsible for the platform-specific half of the conversation: - **config**: account resolution and a setup flow; - **security**: DM policy and allowlists for that platform's senders; - **pairing**: the approval flow for new direct-message senders; - **session grammar**: how platform conversation and thread ids map to OpenClaw sessions; - **outbound** delivery of text, media and polls, plus **threading** rules. Core keeps the shared `message` tool the agent uses on every channel, the prompt wiring, the outer session-key shape and dispatch. A channel plugin therefore does not ship its own send, edit or react tools. Because the adapter implements DM policy, a bug there decides who can reach the agent, so review it as carefully as any access control. ## Getting it running 1. Build the package and install it, for development with `openclaw plugins install --link ./orbit-chat`. 2. Enable it with `openclaw plugins enable orbit-chat`, and add the id to `plugins.allow` if that list is set. 3. Add the `channels.orbit-chat` block; unknown `channels.*` keys are errors unless a plugin manifest declares that channel id. 4. Check registration with `openclaw plugins inspect orbit-chat --runtime --json`, then send a real message through the platform. ## Testing the package before you ship it A linked source checkout hides packaging mistakes. Before publishing, point `openclaw.extensions` at built JavaScript, pack the plugin with `npm pack`, and install the tarball with `openclaw plugins install npm-pack:<file>.tgz`. That path uses the same managed per-plugin npm project as a registry install, so it catches runtime imports that were left in `devDependencies` and therefore never installed. Publishing to ClawHub uses the separate `clawhub` CLI (`clawhub package publish`), after which users install it with `openclaw plugins install clawhub:<package>`. ## Where it goes wrong - Two enabled plugins claiming the same channel produce duplicate-ownership diagnostics; to replace an existing owner on purpose, declare `channelConfigs.<id>.preferOver` and disable the old plugin. - A channel plugin discovered from a workspace extensions root is not imported until it is explicitly enabled, which also blocks its setup code. - A published package without compiled JavaScript fails at load with a message that it requires compiled runtime output for its TypeScript entry.

  • Why does an OpenClaw channel plugin carry both `configSchema` and `channelConfigs`?
    They validate different blocks. `configSchema` covers plugin-owned settings under `plugins.entries.<id>.config`; `channelConfigs.<channel>.schema` covers the channel account config under `channels.<channel>`, and setup and UI surfaces read it before the runtime loads. With strict schemas, a bot token placed in the wrong block fails validation.
  • How do you replace an existing plugin that already owns the same channel id?
    Declare `channelConfigs.<channel-id>.preferOver` with the other plugin's id in the preferred plugin's manifest. If both plugins stay explicitly enabled, OpenClaw keeps that request and reports duplicate channel or tool ownership instead of silently choosing one, so disable the old owner as well.

  • A channel plugin is marked by a kind field in its manifest.
  • The manifest can be skipped when the plugin takes no configuration.
  • Each channel plugin must ship its own send and react tools.
  • OpenClaw imports the plugin's code to validate its configuration.
  • Core applies DM policy for every channel, so an adapter can skip it.