@chat-adapter/notion

中文文档
4.44.0发布于 2026/11/02MITTypeScriptES Module构建来源已验证近 30 天下载 21.4万

Notion adapter for Chat SDK — participate in page and block comment discussions

原始使用文档
文档目录7 节
  1. Installation
  2. Scaffold with the CLI
  3. Quick start
  4. Configuration
  5. Vercel Connect
  6. AI Coding Agents
  7. License

Notion adapter for Chat SDK

@chat-adapter/notion

npm package: @chat-adapter/notion

Agent Stack MIT License

Notion adapter for Chat SDK. Participate in page and block comment discussions via Notion webhooks and the Comments API.

Documentation: chat-sdk.dev/adapters/official/notion · Guides: vercel.com/kb/chat-sdk

Installation

pnpm add @chat-adapter/notion

Scaffold with the CLI

To scaffold a new Notion bot with this adapter preselected:

npx create-chat-sdk@latest my-bot --adapter notion memory

Visit the adapters directory to see other available official and vendor-official adapters.

Quick start

For managed credentials, see Vercel Connect.

The adapter auto-detects credentials from NOTION_TOKEN, NOTION_VERIFICATION_TOKEN, and optional NOTION_BOT_USERNAME / NOTION_VERSION / NOTION_MENTION_MODE / NOTION_KEYWORDS:

import { Chat } from "chat";
import { createNotionAdapter } from "@chat-adapter/notion";

const bot = new Chat({
  userName: "my-bot",
  adapters: {
    notion: createNotionAdapter(),
  },
});

bot.onNewMention(async (thread, message) => {
  await thread.post("Hello from Notion!");
});

Configuration

OptionDescription
tokenNotion access token or async resolver. Auto-detected from NOTION_TOKEN.
verificationTokenNative webhook verification token. Auto-detected from NOTION_VERIFICATION_TOKEN.

Both are required. See the full configuration reference for mention detection and other options.

Vercel Connect

Use connectNotionAdapter to resolve the outbound Notion access token from Vercel Connect:

import { createNotionAdapter } from "@chat-adapter/notion";
import { connectNotionAdapter } from "@vercel/connect/chat";

const notion = createNotionAdapter({
  ...connectNotionAdapter("notion/acme-notion"),
  verificationToken: process.env.NOTION_VERIFICATION_TOKEN,
});

Connect does not forward Notion webhooks. Configure the webhook subscription directly in Notion and keep NOTION_VERIFICATION_TOKEN for native HMAC verification. NOTION_TOKEN is not needed when using the Connect helper.

AI Coding Agents

If you use an AI coding agent such as OpenAI Codex, Claude Code, or Cursor, install the Chat SDK skill so it knows the SDK APIs, adapter patterns, and project conventions before writing code.

npx skills add vercel/chat

The skill references bundled documentation in node_modules/chat/docs, plus adapter guides and starter templates in the published package.

You can also install the Vercel Plugin for a broader agent toolkit — it includes the Chat SDK skill alongside specialist agents, agent slash commands, and more:

npx plugins add vercel/vercel-plugin

The plugin is optional; the skill alone is enough to build with Chat SDK.

For agent-readable documentation, see chat-sdk.dev/llms.txt (page index) or chat-sdk.dev/llms-full.txt (full text).

License

MIT

版本与发布记录

@chat-adapter/notion 共发布 10 个版本,首次发布于 2026/08/05;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.44.0latest2026/11/026 天前
4.43.02026/10/1921 天前
4.42.02026/10/1425 天前
4.41.12026/09/291 个月前
4.41.02026/09/181 个月前
4.40.02026/09/052 个月前

关于 @chat-adapter/notion 的常见问题

@chat-adapter/notion 是什么?

Notion adapter for Chat SDK — participate in page and block comment discussions

如何安装 @chat-adapter/notion?

在项目目录运行 npm install @chat-adapter/notion,或使用 pnpm add / yarn add / bun add。

@chat-adapter/notion 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chat-adapter/notion 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@chat-adapter/notion 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chat-adapter/notion 可以商用吗?

@chat-adapter/notion 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chat-adapter/notion 的下载量有多少?

根据 npm 官方下载统计,@chat-adapter/notion 在 2026/10/10 – 2026/11/08 这 30 天内被下载 214,436 次,日均约 7,148 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@chat-adapter/notion 还在维护吗?

最新版本 4.44.0 发布于 2026/11/02(6 天前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/08/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。