feat: add Notion notes integration#1032
Open
franktronics wants to merge 1 commit into
Open
Conversation
Adds Notion as a fourth note destination alongside Obsidian, Bear, and Octarine. Approved plans (and arrival auto-save, manual export, and the Cmd/Ctrl+S default action) can create a child page under a chosen Notion page via POST /v1/pages with the plan title and Notion-flavored Markdown. The Notion API token is read only from NOTION_TOKEN in the server process environment. It is never stored in cookies, sent from the browser, or included in any API response, snapshot, or log. The UI only persists the non-secret parent page id, enable flag, and auto-save preference. - shared: NotionConfig type + optional url on IntegrationResult - server (Bun + Pi): saveToNotion, wired into /api/save-notes and the approve path with the same Promise.allSettled isolation - ui: notion settings util, Settings tab, ExportModal card, header menu action, and the three App.tsx export triggers - tests: Notion request/token-safety, dispatcher, and page-id parsing - docs: Notion integration guide + README/API endpoint updates Closes backnotprop#434
Author
|
Btw. I'm relatively new to this project. So don't hesitate to let me know if there are any adjustments that need to be made. |
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.
Summary
Closes #434.
Adds Notion as a fourth note destination alongside Obsidian, Bear, and Octarine. A plan can be saved to Notion on approval, on arrival (auto-save), from the Export > Notes modal, from the header menu, and via the
Cmd/Ctrl+Sdefault action.Each export creates a child page under a chosen parent page (
POST /v1/pages), using the plan's first H1 as the title and the plan body as Notion-flavored Markdown.Authentication
Notion differs from the existing integrations: Obsidian writes a local file, Bear/Octarine open a URI scheme, but Notion needs an authenticated HTTPS API.
To keep this a self-hostable, single-PR feature with no new infrastructure, the integration uses a local Notion integration token read only from
NOTION_TOKENin the server process environment:NOTION_TOKEN.A public OAuth flow would require a hosted callback, encrypted refresh-token storage, and a client secret that can't ship in a local plugin — that's a separate follow-up, not this PR.
Setup
NOTION_TOKENset.Changes
NotionConfigtype + optionalurlonIntegrationResult.saveToNotion, wired into/api/save-notesand the approve path with the samePromise.allSettledisolation (an integration failure never blocks approval). Both runtimes updated per AGENTS.md.notionsettings util, Settings tab, ExportModal card, header menu action, and the threeApp.tsxexport triggers. Duplicate-page gating on approve mirrors Bear (Notion creates a new page per call).Testing
bun test packages/server/integrations.test.ts packages/server/shared-handlers.test.ts packages/ui/utils/notion.test.ts(49 pass)bun run typecheck(all packages, incl. Pi vendoring)bun run --cwd apps/review buildandbun run build:hookgit diff --checkNotes