chat / adapter-notion
AGENTS.md2.4k starsChanged 59 days agoMITView on GitHub
Guidance for coding agents working inside the Notion adapter package. The top-level repository AGENTS.md covers monorepo-wide build, lint, and release rules — read it first. @chat-adapter/notion connects a Chat SDK bot to Notion comments (page-level and discussion threads) via: - Webhooks (comment.created) with X-Notion-Signature HMAC verification and a one-time verification_token handshake - Comments REST API (create / update / delete / list / retrieve) - Outbound Vercel Connect authentication via an async token resolver; inbound webhooks remain direct and use…
Trending
Quiet since March.thin dataabout the whole repository
Who's talking about vercel/chat
- @camilleroux.com“Un SDK TypeScript unifié pour créer des chatbots qui fonctionnent sur Slack, Teams, Google Chat, Discord, …”Bluesky · Mar 3, 2026 · 3 likes
- @technews4869.bsky.social“github.com/vercel/chat GitHub - vercel/chat: A unified TypeScript SDK for building chat bots across Slack, …”Bluesky · Mar 7, 2026 · 1 likes
- @yug1224.com“チャットアプリ開発に使える統一SDKを提供するツールらしい 様々なプラットフォーム対応で便利そうだな yug1224 starred vercel/chat https://github.com/vercel/chat”Bluesky · Mar 7, 2026 · 1 likes
- @news.humancoders.com“Vercel lance Chat SDK : un SDK TypeScript unifié pour créer des bots multi-plateformes”Bluesky · Mar 5, 2026 · 1 likes
- @github-trending-js.bsky.social“🔥 Hot Repo! 🔥 (100+ new stars) 📦 vercel / chat ⭐ 871 (+121) 🗒 TypeScript A unified TypeScript SDK for …”Bluesky · Feb 27, 2026 · 1 likes
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apps/docs/AGENTS.mdAGENTS.md
- chat-sdkAGENTS.md
- packages/adapter-discord/AGENTS.mdAGENTS.md
- packages/adapter-gchat/AGENTS.mdAGENTS.md
- packages/adapter-github/AGENTS.mdAGENTS.md
- packages/adapter-instagram/AGENTS.mdAGENTS.md
- packages/adapter-linear/AGENTS.mdAGENTS.md
- packages/adapter-messenger/AGENTS.mdAGENTS.md
- packages/adapter-slack/AGENTS.mdAGENTS.md
- packages/adapter-teams/AGENTS.mdAGENTS.md
- packages/adapter-telegram/AGENTS.mdAGENTS.md
- packages/adapter-web/AGENTS.mdAGENTS.md
- packages/adapter-whatsapp/AGENTS.mdAGENTS.md
- packages/chat/src/adapters/AGENTS.mdAGENTS.md
- packages/create-chat-sdk/AGENTS.mdAGENTS.md
- packages/create-chat-sdk/_template/AGENTS.mdAGENTS.md
- packages/state-ioredis/AGENTS.mdAGENTS.md
- packages/state-memory/AGENTS.mdAGENTS.md
- packages/state-pg/AGENTS.mdAGENTS.md
- packages/state-redis/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- packages/adapter-discord/CLAUDE.mdCLAUDE.md
- packages/adapter-gchat/CLAUDE.mdCLAUDE.md
- packages/adapter-github/CLAUDE.mdCLAUDE.md
- packages/adapter-linear/CLAUDE.mdCLAUDE.md
- packages/adapter-messenger/CLAUDE.mdCLAUDE.md
- packages/adapter-slack/CLAUDE.mdCLAUDE.md
- packages/adapter-teams/CLAUDE.mdCLAUDE.md
- packages/adapter-telegram/CLAUDE.mdCLAUDE.md
- packages/adapter-web/CLAUDE.mdCLAUDE.md
- packages/adapter-whatsapp/CLAUDE.mdCLAUDE.md
- packages/create-chat-sdk/CLAUDE.mdCLAUDE.md
- packages/create-chat-sdk/_template/CLAUDE.mdCLAUDE.md
- packages/state-ioredis/CLAUDE.mdCLAUDE.md
- packages/state-memory/CLAUDE.mdCLAUDE.md
- packages/state-pg/CLAUDE.mdCLAUDE.md
- packages/state-redis/CLAUDE.mdCLAUDE.md
- add-adapterSkill
- technical-writerSkill
- chat-sdkSkill
- chat-sdkSkill
- chat-sdkSkill
- chat-sdkSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 68
When both discussionId and blockId are present, encode prefers discussionId.
- Very specific: line 79
Default "mention" matches plain-text @userName / @botUserId (Notion connection bots are not @-mentionable in the composer).
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — @chat-adapter/notion
Guidance for coding agents working inside the Notion adapter package. The top-level repository AGENTS.md covers monorepo-wide build, lint, and release rules — read it first.
Overview
@chat-adapter/notion connects a Chat SDK bot to Notion comments
(page-level and discussion threads) via:
- Webhooks (
comment.created) withX-Notion-SignatureHMAC verification and a one-timeverification_tokenhandshake - Comments REST API (create / update / delete / list / retrieve)
- Outbound Vercel Connect authentication via an async
tokenresolver; inbound webhooks remain direct and use native Notion HMAC verification - Outbound files via File Uploads API (
single_partbinary +external_urlfor public URLs).external_urlimports are polled untiluploadedbefore attach (default[0, 5000, 10000]— immediate recheck then 5s/10s; override withexternalUrlPollDelaysMs). Never attach whilepending. Up to 3 native comment attachments; overflow/failures/timeouts become markdown links. Edits link files in markdown only (PATCH may not attach). - Post+Edit streaming with a global ~3 req/s token bucket
Directory layout
packages/adapter-notion/
├── src/
│ ├── index.ts # NotionAdapter + createNotionAdapter
│ ├── index.test.ts
│ ├── types.ts
│ ├── utils.ts # thread IDs, HMAC, deep links
│ ├── markdown.ts # NotionFormatConverter
│ ├── cards.ts # card → markdown fallback
│ ├── rate-limit.ts # token bucket
│ └── testing.ts # @chat-adapter/notion/testing
├── package.json
├── tsconfig.json
├── tsup.config.ts
├── vitest.config.ts
└── README.mdPublic surface
createNotionAdapter(config?)/NotionAdapter/NotionAdapterConfigtokenaccepts a static string or async resolver and is resolved for every Notion API request- Env:
NOTION_TOKEN,NOTION_VERIFICATION_TOKEN, optionalNOTION_BOT_USERNAME,NOTION_VERSION,NOTION_MENTION_MODE,NOTION_KEYWORDS - Pinned API version:
DEFAULT_NOTION_VERSION(2026-03-11) - Testing:
@chat-adapter/notion/testing fetchSubject→message.subjectresolves the parent page viaGET /v1/pages/{pageId}(page object / properties onraw, not block children)
Thread IDs
notion:{pageId}
notion:{pageId}:{discussionId}
notion:{pageId}:block:{blockId}UUIDs are normalized to lowercase hyphenated form. Outbound whole-block
discussion starts use notion:{pageId}:block:{blockId} (NotionThreadId.blockId).
When both discussionId and blockId are present, encode prefers discussionId.
Selected-text discussions cannot be started via API.
Non-goals (v0.1)
Reactions, modals, DMs, typing indicators, multi-workspace OAuth, page-content event triggers, selected-text discussion creation.
Mentions
mentionMode: "mention" | "all-comments" | "keyword".
Default "mention" matches plain-text @userName / @botUserId
(Notion connection bots are not @-mentionable in the composer).
NOTION_KEYWORDS is comma-separated when mode is "keyword". A keyword
match reports true; no match leaves isMention undefined so the SDK text
fallback still applies. Only isMe comments report a definitive false.
Where to look next
- Docs:
apps/docs/content/adapters/official/notion.mdx - PRD:
notion-adapter-prd.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

