🌐
WebChat 集成
将 OpenClaw 连接到 WebChat,直接在您的网站中嵌入 AI 助手。
快速开始
- ✓ 在 openclaw.json 中配置 WebSocket Gateway
- ✓ 启用 Gateway 后启动 OpenClaw
- ✓ 在您的网站上嵌入聊天小部件
- ✓ 预计时间:约 5 分钟
设置步骤
步骤 1: 配置 openclaw.json
{
"channels": {
"webchat": {
"enabled": true,
"gateway": {
"port": 3000,
"path": "/ws",
"auth": {
"enabled": true,
"apiKeys": ["your-api-key-1", "your-api-key-2"]
}
}
}
}
} 步骤 2: 启动 OpenClaw
openclaw start WebSocket Gateway 默认将在端口 3000 上启动。
步骤 3: 嵌入聊天小部件
将 OpenClaw 聊天小部件添加到您的网站:
<script src="https://your-openclaw-server.com/widget.js"></script>
<script>
OpenClaw.init({
server: 'wss://your-openclaw-server.com/ws',
apiKey: 'your-api-key',
theme: {
primaryColor: '#FF4500',
position: 'bottom-right'
}
});
</script> 功能特性
可自定义
完全可自定义的小部件外观。
API 密钥
使用 API 密钥进行安全身份验证。
实时响应
WebSocket 实现即时响应。
主题
多种主题选项和深色模式。