OneDrive Quick Sync

approvedunreviewed

by saki

Synchronize your vault with any Microsoft OneDrive folder on mobile and desktop using QuickXorHash and device code authentication.

Updated todayMIT

OneDrive Quick Sync

Synchronize your Obsidian vault with any folder in Microsoft OneDrive (Personal or Work/School) across Mobile (iOS / Android) and Desktop.

一款专为 Obsidian 手机端(iOS / Android)与桌面端 设计的 Microsoft OneDrive 双向同步插件。


Features / 核心特性

  • Mobile & Desktop Native (isDesktopOnly: false): Zero Node.js built-in dependencies; all HTTP calls go through Obsidian's requestUrl to avoid mobile WebView CORS restrictions.
  • OAuth 2.0 Device Code Flow: Sign in seamlessly on mobile or desktop without local redirect HTTP ports. Supports both personal Microsoft accounts (@outlook.com / @hotmail.com) and organizational Entra ID accounts.
  • Three-Way Sync + QuickXorHash: Pure TypeScript implementation of Microsoft's 160-bit QuickXorHash compared directly against OneDrive's server hash, combined with local snapshots to accurately detect additions, edits, deletions, and conflicts.
  • Safe Conflict Resolution: Defaults to Keep Both (saves a .conflict-YYYYMMDD-HHmmss copy), with options for Newer Wins, Local Wins, or Remote Wins.
  • Large File Upload Session: Files larger than 4 MiB automatically use Microsoft Graph Upload Sessions with 320 KiB-aligned chunks, plus a configurable max file size limit (default 50 MB) to prevent mobile OOM.
  • Credential Isolation: Even if you enable .obsidian config sync, data.json (containing your OAuth tokens), workspace.json, and workspace-mobile.json are always excluded.

Network & Privacy Disclosure / 网络与隐私说明

  • Direct Microsoft Connection Only: This plugin communicates exclusively with Microsoft's official endpoints:
    • https://login.microsoftonline.com (OAuth 2.0 Device Code & Token Refresh)
    • https://graph.microsoft.com (Microsoft Graph OneDrive API)
    • Pre-authenticated @microsoft.graph.downloadUrl / upload session URLs returned directly by Microsoft Graph.
  • User-Owned Client ID: You register your own free Azure App Client ID.
  • Zero Telemetry / Zero Relay: No third-party servers, no analytics, and no tracking. OAuth tokens are stored locally in your vault's plugin data.json and never uploaded to OneDrive.

Setup: Register a Free Azure App Client ID (2 Minutes)

  1. Open Azure Portal (portal.azure.com) and sign in with your Microsoft account.
  2. Search for Microsoft Entra ID → App registrations → New registration.
  3. Enter a name (e.g. OneDrive Quick Sync).
  4. Under Supported account types, choose Accounts in any organizational directory and personal Microsoft accounts.
  5. Click Register, then copy the Application (client) ID from the Overview page.
  6. Important: Open Authentication → scroll to Advanced settings → set Allow public client flows to Yes → click Save.

快速配置步骤(中文)

  1. 登录 Azure 门户 (portal.azure.com) → 搜索 Microsoft Entra ID → 应用注册 → 新注册。
  2. 受支持的账户类型选择 「任何组织目录中的账户和个人 Microsoft 账户」。
  3. 注册后在 概述 复制 应用程序(客户端) ID。
  4. 进入左侧 身份验证 → 高级设置 → 将 「允许公共客户端流」 设为 「是」 并保存。

Manual Mobile Installation / 手机端安装方法

  1. Download main.js, manifest.json, and styles.css from the latest GitHub Release.
  2. Copy all three files into <YourVault>/.obsidian/plugins/onedrive-quick-sync/.
  3. In Obsidian: Settings → Community plugins → enable OneDrive Quick Sync.
  4. Open Settings → OneDrive Quick Sync, paste your Client ID, tap 登录 OneDrive, select your OneDrive folder, and run 预览同步变更 or 立即双向同步.

Development / 开发与测试

npm install        # Install dependencies
npm run typecheck  # Run TypeScript strict typecheck
npm test           # Run Vitest unit tests
npm run build      # Build production main.js

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.