No description
Find a file
choisungwook aa0ba07021
Add sync folder scope setting and OAuth public integration guide (#18)
* Add OAuth public integration guide to README and bump to 0.1.11

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Add folder scope setting for Notion sync

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 14:47:07 +09:00
.github Potential fix for code scanning alert no. 1: Workflow does not contain permissions (#16) 2026-07-19 14:16:34 +09:00
src Add sync folder scope setting and OAuth public integration guide (#18) 2026-07-19 14:47:07 +09:00
tests Add sync folder scope setting and OAuth public integration guide (#18) 2026-07-19 14:47:07 +09:00
wiki Add sync folder scope setting and OAuth public integration guide (#18) 2026-07-19 14:47:07 +09:00
.gitignore Add obsidian-notion-sync plugin (#1) 2026-07-17 00:31:53 +09:00
AGENTS.md Restore automated release publishing with gh CLI and ship 0.1.7 (#13) 2026-07-18 16:57:40 +09:00
CLAUDE.md Add obsidian-notion-sync plugin (#1) 2026-07-17 00:31:53 +09:00
esbuild.config.mjs Embed plugin version in main.js to fix marketplace attestation failure (#8) 2026-07-17 11:53:30 +09:00
LICENSE Initial commit 2026-07-16 00:45:16 +09:00
manifest.json Add sync folder scope setting and OAuth public integration guide (#18) 2026-07-19 14:47:07 +09:00
package-lock.json Refresh release assets when tag already exists (#4) 2026-07-17 09:04:07 +09:00
package.json Bump plugin version to 0.1.1 to ship pending changes to marketplace (#6) 2026-07-17 09:53:36 +09:00
README.md Add sync folder scope setting and OAuth public integration guide (#18) 2026-07-19 14:47:07 +09:00
tsconfig.json Restructure repo for Obsidian marketplace submission (#2) 2026-07-17 01:09:28 +09:00
versions.json Add sync folder scope setting and OAuth public integration guide (#18) 2026-07-19 14:47:07 +09:00
vitest.config.ts Refresh release assets when tag already exists (#4) 2026-07-17 09:04:07 +09:00

Akbun Notion Sync

Desktop-only Obsidian plugin that syncs every markdown note in your vault to Notion as child pages of a parent page.

How it works

  • Walks the whole vault, hashes each note with sha256, and compares against the last synced state (~/.config/akbun-notion-sync/sync-state.json).
  • New notes are created as Notion pages, changed notes are updated in place, and notes deleted from the vault are archived in Notion.
  • Notion API calls are throttled to 3 requests per second, and progress is shown via Obsidian notices.

Authentication

Two options, selectable in the settings tab:

  1. Integration token — paste an internal integration secret from notion.so/my-integrations. Remember to share the parent page with the integration.
  2. OAuth — enter your public integration's client ID and secret, register http://localhost:43110/callback as its redirect URI, then click Connect. Your browser opens Notion's consent page and the plugin receives the code on a temporary localhost server.

Credentials are stored in ~/.config/akbun-notion-sync/credentials.json with 0600 permissions — never inside the vault, so syncing your vault with git or cloud storage cannot leak tokens.

OAuth public integration guide

Notion's OAuth flow requires your own public integration — Notion does not support a client-less (PKCE-only) flow, so a client ID and secret are always needed. Set one up once:

  1. Open notion.so/my-integrations and click New integration.

  2. Under Type, choose Public. Fill in the required fields (name, company/website, privacy policy and terms URLs — personal links are fine for private use).

  3. In Redirect URIs, add exactly:

    http://localhost:43110/callback
    

    The plugin listens on this port only while the Connect button is waiting for the callback.

  4. Save, then copy the OAuth client ID and OAuth client secret from the integration's Configuration tab.

  5. In Obsidian, open the plugin settings, select OAuth as the authentication method, paste the client ID and secret, and click Connect.

  6. Your browser opens Notion's consent page. Pick the workspace and pages to share (include the parent page you sync into), then approve. The tab will say you can close it, and Obsidian shows a "Connected to Notion" notice.

The client secret and the access token are saved to ~/.config/akbun-notion-sync/credentials.json; you only need the secret again if you reconnect.

If this feels heavy, the Integration token method is simpler for a single personal workspace — create an internal integration, paste its token, and share the parent page with it.

Settings

  • Notion parent page ID — the page under which synced notes are created.
  • Folders to sync — comma-separated vault folder paths (e.g. notes, work/projects). Empty syncs the whole vault. Notes outside these folders are never created, updated, or archived — narrowing the scope leaves already-synced Notion pages untouched.
  • Sync interval (minutes)0 means manual only; otherwise the vault syncs automatically at that interval.
  • Sync now — trigger a sync immediately; the last sync time and result are shown next to the button.

Development

npm install
npm run dev     # watch build
npm test        # vitest unit tests
npm run build   # type-check + production bundle (main.js)

Copy main.js and manifest.json into <vault>/.obsidian/plugins/akbun-notion-sync/ to install a local build.