AstronClaw 连接 Notion 完整指南
本文记录如何为 AstronClaw 配置 Notion 集成,实现页面创建、内容写入和数据库操作。
⏱️ 配置时间:约 3 分钟 | 难度:简单前置条件
- 已安装 Notion skill (通过 ClawHub)
- 拥有 Notion 账号
步骤一:创建 Notion Integration
- 访问 notion.so/my-integrat…
- 创建新的内部集成
- 填写名称(如 "OpenClaw"),选择关联的工作区
- 点击提交后,复制生成的 API Key(以 ntn_ 或 secret_ 开头)
步骤二:存储 API Key
将 API Key 保存到配置文件(直接交给AstronCLaw即可):
mkdir -p ~/.config/notion
echo 'ntn_你的API密钥' > ~/.config/notion/api_key
步骤三:授权页面访问
重要:Notion API 需要显式授权才能访问页面。
- 在 Notion 中打开你想让 OpenClaw 访问的页面
- 点击右上角 "..." 菜单
- 选择 "Connect to" → 选择你创建的 Integration 名称
步骤四:验证连接
让 OpenClaw 测试连接,搜索已授权的页面即可验证。
常见问题
Q: 为什么搜索不到页面?
A: 确保页面已通过 "Connect to" 授权给你的 Integration。
Q: API 返回 401 错误?
A: 检查 API Key 是否正确,确保文件路径为 ~/.config/notion/api_key。