feat(notion): add Notion comments adapter#689
Open
bensabic wants to merge 5 commits into
Open
Conversation
Adds @chat-adapter/notion for Notion page and block comment discussions: webhook HMAC verification, Post+Edit streaming with markdown chunking, conversation history, message.subject page metadata, plain-text @userName/@botUserId mention detection, and File Uploads (up to 3 native attachments). Registers the adapter in the chat/adapters catalog and create-chat-sdk scaffold, and adds Notion emoji platform support. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The table-separator pattern had `|` in the character class immediately followed by a `\|` literal; on a line with many spaces the engine backtracked over the class trying to place the trailing pipe. Drop the trailing literal (the `^...$` anchored single-quantifier class is enough to match separator rows), keeping behavior while removing the super-linear path. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
@chat-adapter/notion, an official adapter that lets a Chat SDK bot take part in Notion comment discussions (page-level and block/discussion threads) with the same handler code used for Slack, Linear, GitHub, etc. Inbound events arrive via Notion webhooks (comment.created) with HMAC signature verification; outbound actions use the Comments REST API. Because Notion lets a connection edit its own comments, the adapter supports Post+Edit streaming.Highlights
comment.createdverified withX-Notion-SignatureHMAC over the raw body (timing-safe), plus the one-timeverification_tokenhandshake. Returns a fast 200 with idempotent, state-backed dedupe.PATCHes the comment as tokens arrive, throttled to Notion's ~3 req/s limit (global token bucket,Retry-Afteraware). Long bodies are split into sequential comments to stay under the 2000-char rich-text cap.mention(default; plain-text@userName/@botUserId),all-comments, andkeyword.message.subject— resolves the parent page via the Pages API (title, url, archived status, author).single_part; public URLs viaexternal_urlwith bounded polling); overflow and failures fall back to markdown links.fetchMessagesover list-comments (open comments only), direction-aware.chat/adapterscatalog and thecreate-chat-sdkscaffold; pinned toNotion-Version: 2026-03-11.Usage
Configuration
Auto-detects
NOTION_TOKENandNOTION_VERIFICATION_TOKEN, plus optionalNOTION_BOT_USERNAME,NOTION_MENTION_MODE,NOTION_KEYWORDS, andNOTION_VERSION; everything is overridable viacreateNotionAdapter({ … }). The docs page covers the full connection + webhook setup (capabilities, content access, and the webhook-URL-lock warning).Changeset bumps
@chat-adapter/notion,chat, andcreate-chat-sdk(minor). Layered as four commits:feat(adapter + catalog/scaffold/emoji),docs,test,chore(example).