Sync Obsidian notes holding book progress to Goodreads

Goodreads Sync #

Sync reading status and progress from your Obsidian book notes to Goodreads.

Status: disabled in the author's vault. A BookOrbit plugin for books.diego.codes will replace it.

What it does #

  • Scans the configured folders for book notes and pushes changes to Goodreads: the reading status moves the book to a shelf, and the progress posts a reading update (by page when the note tracks pages, by percentage otherwise).
  • Pulls from Goodreads too: when a note has no status, it imports the book's shelf as the status, and when a note has no cover:, it adds the cover URL to the frontmatter and embeds the image at the top of the note.
  • Shows a preview of every pending change before it sends anything, and each change can be switched off.
  • Asks you to link notes that have no Goodreads ID, with a search of Goodreads by title and author.
  • Remembers the last synced status and progress of each book, so a sync only sends what changed.

Desktop only, and in practice macOS only: the authorization step opens the browser with the open command.

Installation #

The plugin is not in the Community Plugins directory. Build it from source:

npm ci && npm run build

Copy main.js, manifest.json and styles.css to <vault>/.obsidian/plugins/goodreads-sync/, then enable Goodreads Sync in Settings → Community plugins.

Settings #

Setting Default Description
Goodreads account not connected Two-step OAuth authorization. Open Goodreads opens the authorization page in the browser; after allowing the app, Complete authorization stores the token. Disconnect removes it.
Book folders Reference/Books Folders to scan, one per line. Only notes directly inside each folder are read, not subfolders.
Status field status Frontmatter field that holds the reading status.
Shelf mappings to-read → to-read, reading → currently-reading, read → read, stopped → stopped-reading Status value → Goodreads shelf. Rows can be edited, added and removed; Restore defaults resets them.
Book mappings none Shows how many notes are linked to Goodreads books. Clear removes every link.

The OAuth token and the book links are stored in the plugin's data.json.

Usage #

Book notes #

A note counts as a book when its frontmatter type contains Book or its tags include highlights. The plugin reads these fields:

Field Use
aliases The first alias is the title; the file name otherwise.
author Author name or list of names; [[wikilinks]] are stripped. Used for the Goodreads search.
goodreads_id Goodreads book ID. A note with it is linked without a prompt.
current_page, total_pages Page-based progress. Sent to Goodreads as a page number.
progress Progress as a fraction from 0 to 1, used when there are no page fields. Sent as a percentage.
status (configurable) Reading status, mapped to a shelf through Shelf mappings.
cover Written by the plugin with the full-size Goodreads cover URL.

Commands #

  • Sync reading progress to Goodreads (also the book icon in the ribbon): links unlinked books, works out the pending changes, shows the preview, and runs the selected changes.
  • Link current note to Goodreads book: takes a goodreads.com/book/show/<id> URL, writes goodreads_id and the cover to the active note.
  • Open book cover in browser: takes a Goodreads book URL and opens its full-size cover image.

Development #

npm ci
npm run dev    # rebuild main.js on change
npm run build  # type-check and production build
npm run lint   # eslint

The source is in src/: main.ts (commands and sync logic), goodreads.ts (OAuth 1.0a signing and the Goodreads XML API), vault-scanner.ts (finds book notes and reads their frontmatter), link-book-modal.ts, sync-preview-modal.ts and settings.ts.

License #

0-BSD.