Skip to content

amgud/obsidian-drive-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Obsidian Drive Sync

Keep your Obsidian vault synchronized with Google Drive automatically! ☁️ This plugin allows you to backup and sync your notes to Google Drive in two modes: hidden app-specific storage or a visible folder you can access directly.

✨ Features

  • ⚑ Sync on Save: Automatically sync files the moment they're saved (NEW!)
  • πŸ”„ Automatic Sync: Set up automatic syncing at regular intervals
  • πŸ”’ Two Storage Options: Choose between hidden app-specific storage or visible Google Drive folder
  • πŸš€ Manual Sync: Optional ribbon icon and command palette sync (can be disabled)
  • πŸŽ›οΈ Flexible Sync Options: Mix and match sync methods to fit your workflow
  • πŸ“± Cross-Platform: Works on desktop and mobile Obsidian apps
  • πŸ” Secure Authentication: Uses OAuth2 for secure Google Drive access

πŸ“ Storage Options

πŸ”’ Hidden Storage (App Data Folder)

  • πŸ“‚ Files are stored in Google Drive's hidden app-specific folder
  • 🧹 Files won't clutter your main Google Drive
  • πŸ” Only accessible through this plugin
  • ⭐ Recommended for most users

πŸ‘€ Visible Storage (Custom Folder)

  • πŸ“‚ Files are stored in a folder you can see in your Google Drive
  • πŸ“ Default folder name: "Obsidian Vault" (customizable)
  • πŸ” You can access and manage files directly from Google Drive
  • 🀝 Good for sharing or manual file management

πŸ“₯ Installation

Method 1: Manual Installation (Recommended)

  1. Download the latest release from the Releases page
  2. Extract the files to your vault's plugin folder:
    VaultFolder/.obsidian/plugins/obsidian-drive-sync/
    
  3. Enable the plugin in Obsidian Settings β†’ Community Plugins

Method 2: Building from Source

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run build to build the plugin
  4. Copy main.js, manifest.json, and styles.css to your plugin folder

πŸ”§ Google Drive API Setup

Before using the plugin, you need to set up Google Drive API access:

πŸš€ Step 1: Create a Google Cloud Project

  1. 🌐 Go to the Google Cloud Console
  2. πŸ“‚ Click "Select a project" β†’ "New Project"
  3. ✏️ Enter a project name (e.g., "Obsidian Drive Sync")
  4. βœ… Click "Create"

πŸ”Œ Step 2: Enable Google Drive API

  1. πŸ“š In your project, go to "APIs & Services" β†’ "Library"
  2. πŸ” Search for "Google Drive API"
  3. πŸ“ Click on "Google Drive API" and then "Enable"

πŸ—οΈ Step 3: Create OAuth2 Credentials

  1. πŸ› οΈ Go to "APIs & Services" β†’ "Credentials"
  2. βž• Click "Create Credentials" β†’ "OAuth 2.0 Client IDs"
  3. βš™οΈ If prompted, configure the OAuth consent screen:
    • 🌍 Choose "External" user type
    • πŸ“ Fill in required fields (App name, User support email, Developer email)
    • πŸ‘€ Add your email to "Test users" if in testing mode
    • πŸ’Ύ Save and continue through all steps
  4. πŸ’» For Application type, select "Desktop application"
  5. 🏷️ Enter a name (e.g., "Obsidian Drive Sync")
  6. ✨ Click "Create"
  7. πŸ“‹ Copy and save the Client ID and Client Secret - you'll need these!

πŸ›‘οΈ Step 4: Configure OAuth Consent Screen (Important)

  1. βš™οΈ Go to "APIs & Services" β†’ "OAuth consent screen"
  2. πŸ”‘ Add the following scope:
    • https://www.googleapis.com/auth/drive.file
  3. πŸ‘€ Add your email address to "Test users"
  4. πŸ’Ύ Save the configuration

βš™οΈ Plugin Configuration

πŸ”‘ Step 1: Enter API Credentials

  1. πŸ”§ Open Obsidian Settings β†’ Community Plugins β†’ Obsidian Drive Sync
  2. πŸ“‹ Enter your Client ID and Client Secret from Google Cloud Console

πŸ” Step 2: Authenticate with Google Drive

  1. πŸ”— Click "Get Auth URL" button
  2. πŸ“‹ The authentication URL will be copied to your clipboard automatically
  3. 🌐 Paste the URL in your browser and sign in to Google
  4. βœ… Grant permissions to access Google Drive
  5. πŸ“„ Copy the authorization code from the browser
  6. πŸ“‹ Paste the authorization code in the plugin settings
  7. πŸŽ‰ You should see a success message

πŸ“‚ Step 3: Configure Storage Options

πŸ“ Storage Location:

  • πŸ”’ Hidden (App Data Folder): Recommended - files stored in hidden app folder
  • πŸ‘€ Visible (Custom Folder): Files stored in a visible Google Drive folder

πŸ“ Visible Folder Name: (Only for visible storage)

  • πŸ“‚ Default: "Obsidian Vault"
  • ✏️ Change this to customize your folder name

πŸš€ Manual Sync:

  • πŸ‘† Toggle to enable/disable ribbon button and command
  • ☁️ On-demand syncing when you need it
  • πŸ”„ Restart Obsidian required when changing this setting

⚑ Sync on Save:

  • πŸ’Ύ Toggle to sync files instantly when saved
  • πŸš€ Most responsive option - syncs immediately after Ctrl/Cmd+S
  • πŸ”„ Restart Obsidian required when changing this setting

⏰ Auto Sync:

  • πŸ”„ Toggle automatic syncing on/off
  • ⏱️ Set sync interval (1-60 minutes)

🎯 Usage

You can enable any combination of these sync methods to fit your workflow:

πŸš€ Manual Sync

  • ☁️ Click the cloud icon in the ribbon (left sidebar)
  • 🎨 Or use Command Palette: "Sync vault with Google Drive"
  • πŸŽ›οΈ Can be disabled in settings to clean up UI if not needed

⚑ Sync on Save (Recommended)

  • πŸ’Ύ Enable "Sync on Save" in settings for instant backup
  • πŸš€ Files sync automatically every time you save (Ctrl/Cmd+S)
  • 🎯 Most efficient - only syncs the file you just modified

πŸ€– Automatic Sync

  • ⚑ Enable "Auto Sync" in settings
  • ⏰ Choose sync interval (default: 5 minutes)
  • πŸ”„ Plugin will sync automatically in the background

πŸŽ›οΈ Mix and Match

  • βœ… Use all three methods together for maximum coverage
  • βœ… Use only "Sync on Save" for minimal, responsive syncing
  • βœ… Use "Auto Sync" + "Manual Sync" for traditional workflow
  • βœ… Disable "Manual Sync" if you prefer fully automated syncing

πŸ” Authentication Issues

  • πŸ”„ Use Command Palette: "Authenticate Google Drive" to re-authenticate
  • βœ… Check that your OAuth consent screen is properly configured
  • πŸ”‘ Ensure you're using the correct Client ID and Secret

πŸ› οΈ Troubleshooting

❌ "Authentication failed" Error

  1. πŸ” Double-check your Client ID and Client Secret
  2. βœ… Make sure you've enabled Google Drive API in Google Cloud Console
  3. πŸ›‘οΈ Verify OAuth consent screen is configured with correct scopes
  4. πŸ”„ Try generating a new authorization code

🚫 "Please authenticate with Google Drive first" Error

  1. βœ… Complete the authentication process in plugin settings
  2. πŸ“‹ Make sure the authorization code was entered correctly
  3. 🌐 Check that you have internet connectivity

πŸ“ Files Not Syncing

  1. πŸ” Check Obsidian's console (Ctrl/Cmd + Shift + I) for error messages
  2. πŸ’Ύ Verify your Google Drive has sufficient storage space
  3. πŸ‘† Try manual sync first before enabling auto-sync
  4. πŸ” Ensure you have the necessary permissions in Google Drive

πŸ” Can't Find Synced Files in Google Drive

  • πŸ”’ If using "Hidden" storage, files are in the app-specific folder and not visible in your regular Google Drive
  • πŸ‘€ If using "Visible" storage, look for the folder name you specified (default: "Obsidian Vault")

πŸ”’ Privacy & Security

  • 🏠 Your data stays yours: Files are stored in your Google Drive account
  • 🚫 No third-party servers: Direct connection between Obsidian and Google Drive
  • πŸ›‘οΈ Secure authentication: Uses OAuth2 standard with refresh tokens
  • 🎯 Minimal permissions: Only requests access to files created by the app

πŸ†˜ Support

If you encounter issues:

  1. πŸ“– Check the troubleshooting section above
  2. πŸ” Look for error messages in Obsidian's developer console
  3. πŸ› Create an issue on GitHub with:
    • ❗ Error messages from the console
    • πŸ”„ Steps to reproduce the problem
    • πŸ“Š Your Obsidian and plugin versions

πŸ“„ License

MIT License - see LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors