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

@searchfe/openclaw-baiduapp

v0.1.2

Published

OpenClaw Baidu App channel plugin (百度App消息渠道插件)

Readme

OpenClaw 接入百度App 配置指南

本指南帮助你配置百度App渠道,并接入 OpenClaw。

⚠️ 重要提示:Baidu App 插件专注于文本私聊场景,不支持群聊和媒体消息(图片/语音/文件)。

功能概览

| 功能 | 状态 | | :------------- | :--: | | 文本消息 | ✅ | | 主动发送消息 | ✅ | | 私聊 | ✅ | | 群聊 | ❌ | | 图片/语音/文件 | ❌ | | Webhook 回调 | ✅ | | 多账户 | ✅ | | 访问控制策略 | ✅ |

前置条件

  1. 百度App 开发者账号
  2. 公网可访问的 HTTPS 服务器(用于接收回调)
  3. OpenClaw 已安装并运行

步骤一:安装插件

方式一:从 npm 安装

openclaw plugins install @searchfe/openclaw-baiduapp

步骤二:获取百度平台凭证

在百度App 开发者平台注册应用后,获取以下信息:

  • App Key:应用标识
  • App Secret:应用密钥
  • Token:消息校验 Token
  • EncodingAESKey:消息加密密钥(43 位字符)

步骤三:配置 OpenClaw

使用命令行配置

openclaw config set channels.openclaw-baiduapp.enabled true
openclaw config set channels.openclaw-baiduapp.webhookPath /openclaw-baiduapp
openclaw config set channels.openclaw-baiduapp.token your-token
openclaw config set channels.openclaw-baiduapp.encodingAESKey your-43-char-encoding-aes-key
openclaw config set channels.openclaw-baiduapp.appKey your-app-key
openclaw config set channels.openclaw-baiduapp.appSecret your-app-secret

或直接编辑配置文件

编辑 ~/.openclaw/openclaw.json

{
    "channels": {
        "openclaw-baiduapp": {
            "enabled": true,
            "webhookPath": "/openclaw-baiduapp",
            "token": "your-token",
            "encodingAESKey": "your-43-char-encoding-aes-key",
            "appKey": "your-app-key",
            "appSecret": "your-app-secret"
        }
    }
}

配置说明

| 字段 | 必填 | 说明 | | :--------------- | :--: | :------------------------------ | | enabled | ✅ | 是否启用该渠道 | | webhookPath | ✅ | 回调路径,需与百度平台配置一致 | | token | ✅ | 消息校验 Token | | encodingAESKey | ✅ | 消息加密密钥(43 位) | | appKey | ✅ | 应用 App Key(主动发送必需) | | appSecret | ✅ | 应用 App Secret(主动发送必需) | | welcomeText | ❌ | 用户首次进入时的欢迎语 | | dmPolicy | ❌ | 私聊策略(默认 pairing) | | allowFrom | ❌ | 私聊白名单用户 ID 列表 |

环境变量支持

默认账户的凭证也可以通过环境变量设置:

| 环境变量 | 对应配置 | | :--------------------------- | :--------------- | | BAIDU_APP_TOKEN | token | | BAIDU_APP_ENCODING_AES_KEY | encodingAESKey | | BAIDU_APP_KEY | appKey | | BAIDU_APP_SECRET | appSecret |


步骤四:重启 Gateway

openclaw gateway restart

步骤五:验证配置

  1. 在百度平台配置 Webhook 回调地址,指向你的 OpenClaw Gateway
  2. 平台验证通过后,发送一条测试消息
  3. 查看 OpenClaw 日志确认消息接收和回复

高级配置

访问控制

{
    "channels": {
        "openclaw-baiduapp": {
            "enabled": true,
            "dmPolicy": "open",
            "allowFrom": []
        }
    }
}

| 字段 | 说明 | | :---------- | :--------------------------------------------------------------------------------------- | | dmPolicy | 私聊策略:open(任何人)/ pairing(配对)/ allowlist(白名单)/ disabled(禁用) | | allowFrom | 私聊白名单用户 ID 列表(当 dmPolicyallowlist 时生效) |

多账户配置

{
    "channels": {
        "openclaw-baiduapp": {
            "enabled": true,
            "accounts": {
                "bot1": {
                    "webhookPath": "/openclaw-baiduapp-1",
                    "token": "token-1",
                    "encodingAESKey": "key-1",
                    "appKey": "app-key-1",
                    "appSecret": "secret-1"
                },
                "bot2": {
                    "webhookPath": "/openclaw-baiduapp-2",
                    "token": "token-2",
                    "encodingAESKey": "key-2",
                    "appKey": "app-key-2",
                    "appSecret": "secret-2"
                }
            }
        }
    }
}

提示:多账号共用同一路径/Token 时,系统会使用第一个匹配的账号。建议每个账号使用独立的 webhookPath


常见问题

Q: 保存配置时提示验证失败?

  1. 检查 OpenClaw 是否已启动并监听正确端口
  2. 确认 webhookPath 与平台 URL 路径一致
  3. 确认 tokenencodingAESKey 与平台配置完全一致
  4. 确认服务器公网可访问

Q: 消息接收成功但发送失败?

  1. 检查 appKeyappSecret 是否正确
  2. 查看 OpenClaw 日志获取详细错误信息

Q: 如何使用 target 发送消息?

# 使用 user: 前缀
send user:userId123 你好

# 使用 openclaw-baiduapp: 完整前缀
send openclaw-baiduapp:user:userId123 你好

# 指定账户
send user:userId123@bot1 你好

开发验证

pnpm test