obsidotion
unlistedby p32929
a simple obsidian plugin that syncs from/to obsidian/notion
obsidotion
Sync your Obsidian notes with a Notion database. Upload your notes to Notion with one click, and pull the changes you make in Notion back into Obsidian. Works on desktop and mobile.
Safe with the rest of your Notion. obsidotion only updates or archives pages it created or pulled itself, so pages you made in Notion are never touched. Your note properties, like tags, are kept as they are.
Screenshots
From Windows
From Android
Set up Notion
You do this once. It gives the plugin a key to your Notion and a database to put your notes in.
- Open notion.so/my-integrations and click New integration.
- Give it a name (for example
Obsidian), pick your workspace, and save. - Copy the Internal Integration Secret. It starts with
ntn_orsecret_. This is your token. - In Notion, create a new page and choose Table to make a database. Keep its first column, Name: that is where note titles go.
- On the database page, click ••• (top right), then Connections, then add the integration you made in step 2. Without this, the plugin cannot see the database.
- Copy the database link (•••, then Copy link). The database ID is the 32 characters before the
?. For example, inhttps://www.notion.so/myname/8f3a1c2b9d4e4f6a8b7c6d5e4f3a2b1c?v=1234the ID is8f3a1c2b9d4e4f6a8b7c6d5e4f3a2b1c.
Install the plugin
- Open the latest release and download
obsidotion-plugin.zip. - In your vault, open the folder
.obsidian/plugins(show hidden files if you cannot see.obsidian). Make a new folder in it calledobsidotion. - Unzip the file and put
main.js,manifest.jsonandstyles.cssinside thatobsidotionfolder. - Open Obsidian, go to Settings, then Community plugins, and turn on obsidotion. (If Obsidian asks, turn off Restricted mode first.)
- Open the plugin's settings and paste your token and database ID.
Use it
- Upload: click the cloud with an up arrow in the left ribbon (or run "Upload to Notion" from the command palette). Each note becomes a page in your database. The next time, only notes you changed, added or renamed are uploaded.
- Pull: click the cloud with a down arrow (or run "Pull from Notion"). Notes whose page you changed in Notion get the Notion version, and new pages you made in Notion are added as notes (in a
Notionfolder, or back in their old folder if obsidotion uploaded them before). It asks you once before it changes anything. - The plugin adds a few lines to the top of each synced note (
notionID,link,lastSync,filePath,contentHash,notionHash). Leave them there: that is how it remembers which page belongs to which note. Your own frontmatter, like tags, stays as it is. - When you delete a note and upload again, its Notion page is archived (you can restore it from Notion's Trash).
- It never archives pages it did not make or pull itself, so other pages in the database are safe. If a note cannot be read during an upload, nothing is archived that time.
Good to know
- Sync only happens when you click Upload or Pull. Nothing runs in the background.
- Pull replaces the text of a note with the Notion version. If you changed the same note in both places, the last action wins, so upload or pull right after you finish editing.
- Supported: headings, paragraphs, bold, italic, code, strikethrough, links, bullet lists (also nested), numbered lists, checkboxes, quotes, code blocks, tables and images with a web link. Horizontal lines (
---) and Obsidian-only things like[[wiki links]]and embeds are sent as plain text or left out. - Notion allows about 3 requests a second, so the first upload of a big vault takes a while. Long notes are sent in parts, so there is no size limit you need to think about.
- Notes synced with version 1.0 keep working. The first pull after updating only records the current state of each page and does not change the text of your existing notes.
Build it yourself
- Clone this repo and run
npm install. - Run
npm run buildto makemain.js, ornpm run devto rebuild on every change. - Run
npm testto run the tests (they use a fake Notion, no account needed). - Optional: create a
.envfile withOBSIDIAN_VAULT_PATH=/path/to/vault/.obsidian/pluginsandPLUGIN_ID=obsidotion, and every build is copied into your vault.
License
MIT License — Copyright (c) 2024 Fayaz Bin Salam. See LICENSE for the full text.
Contributing
Contributions are very welcome, thank you! Before you start on a pull request, please open an issue and tell me what you would like to add or change. That way we can agree on it first, and your time is not wasted on something that might not fit. Thanks for helping make obsidotion better.
You might also like
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.