Skip to content

外部服务集成

OpenClaw 可以接入各种外部服务和 API。

🔌 集成方式

1. 通过 Skill

创建 Skill 调用外部 API:

typescript
// tools/api-call.ts
export default {
  name: 'api_call',
  execute: async (params) => {
    const response = await fetch(params.url, {
      method: 'POST',
      body: JSON.stringify(params.data)
    })
    return response.json()
  }
}

2. 通过 API Gateway

使用 api-gateway 技能,支持 OAuth:

yaml
skills:
  - api-gateway

支持的服务:

  • Google Workspace
  • Microsoft 365
  • GitHub
  • Notion
  • Slack
  • ...

3. 通过 Webhook

配置 Webhook 接收外部事件:

yaml
webhooks:
  - path: /webhook/github
    handler: github-handler

📚 常见集成

GitHub

yaml
skills:
  - github

使用 gh CLI 操作 GitHub。

Notion

yaml
skills:
  - notion

需要配置 Notion API Key。

Google Workspace

yaml
skills:
  - gog

通过 OAuth 授权。

更多内容

(待补充)

养虾俱乐部 - OpenClaw 中文社区