A powerful Obsidian plugin that enables seamless synchronization of your vault across multiple devices using LAN connectivity and Google Drive backup.
- Cross-device sync: Sync your vault with other devices on your local network
- IP-based connection: Simply enter an IP address to connect to another device
- Real-time updates: Sync notes as you save them or manually trigger sync
- Multi-device support: Connect to multiple devices simultaneously
- Cloud backup: Automatically backup your notes to Google Drive
- OAuth 2.0 authentication: Secure Google login with persistent session management
- Folder organization: Dedicated folder in Google Drive for synced notes
- Automatic sync: Sync on save or on a schedule
- Auto-sync: Configure automatic sync intervals
- Sync on save: Automatically sync when you save a note
- Manual sync: Trigger full sync with a single button click
- File filtering: Sync only files matching your pattern
- Clone or download this repository
git clone https://github.com/yourusername/obsidian-nasync.git
cd obsidian-nasync- Install dependencies
npm install- Build the plugin
npm run build-
Install in Obsidian
- Open Obsidian and go to Settings β Community Plugins
- Click "Browse" and search for "NAsync" (once it's published)
- Or copy the built files to your vault's
.obsidian/plugins/obsidian-nasync/directory:main.jsmanifest.jsonstyles.css(if present)
-
Enable the plugin
- Go to Settings β Community Plugins β Installed Plugins
- Enable "NAsync"
- Install Obsidian Mobile from Google Play Store
- Install the plugin using the same method as desktop
- Access plugin settings from the mobile app to configure LAN and Google Drive sync
- Go to Plugin Settings β NAsync β LAN Sync
- Enable "Enable LAN Sync"
- Set your "Device Name" (how other devices will see you)
- On another device, enable LAN Sync and enter this device's IP address in the "Connect to Device" field
- Click "Connect" - you should see the device listed in "LAN Sync Devices"
Finding your device IP:
- Windows: Open Command Prompt and type
ipconfig, look for "IPv4 Address" - Mac/Linux: Open Terminal and type
ifconfig, look for "inet" address - Mobile: Go to Settings β About Phone β Network, or use a WiFi analyzer app
-
Create OAuth 2.0 credentials:
- Go to Google Cloud Console
- Create a new project
- Enable the Google Drive API
- Create OAuth 2.0 credentials (Desktop application)
- Copy the Client ID and Client Secret
-
Configure in Obsidian:
- Go to Plugin Settings β NAsync β Google Drive Sync
- Enable "Enable Google Drive Sync"
- Paste your Client ID and Client Secret
- Click "Login with Google"
- Authorize the app to access your Google Drive
- The plugin will create a dedicated folder in your Drive
-
Set sync folder name (optional):
- Default is "Obsidian-Sync"
- Change in settings if desired
- Click the sync icon in the Obsidian ribbon (left sidebar)
- Or go to Settings β NAsync β Manual Sync β "Sync All"
- Enable "Sync on Save" to sync every time you edit a note
- Or enable "Auto-Sync" and set an interval (minimum 30 seconds)
- Use glob patterns to sync only specific files (default:
**/*.md) - Examples:
**/*.md- all markdown filesNotes/**/*.md- only files in Notes folder**/{work,projects}/**/*.md- specific folders
- Manages LAN connections to other devices
- Handles file transfer over HTTP
- Maintains device registry and connection status
- Supports peer-to-peer sync
- Manages OAuth 2.0 authentication with Google
- Handles file upload/download from Google Drive
- Creates and manages sync folders
- Supports file versioning and updates
- Integrates both sync services
- Manages sync triggers (on save, auto, manual)
- Handles file modifications and deletions
- Provides settings UI for configuration
obsidian-nasync/
βββ main.ts # Main plugin file
βββ src/
β βββ services/
β β βββ LANSyncService.ts
β β βββ GoogleDriveSyncService.ts
β βββ SettingsTab.ts # Settings UI
βββ manifest.json # Plugin metadata
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript config
βββ esbuild.config.mjs # Build configuration
βββ README.md
npm run devThis will watch for changes and rebuild automatically.
npm run build- Incremental sync (only sync changed files)
- File conflict resolution
- Selective folder sync
- Sync history and logs
- Built-in server for easier mobile setup
- Support for other cloud providers (OneDrive, Dropbox)
- End-to-end encryption
- Bandwidth throttling
- Ensure both devices are on the same WiFi network
- Check firewall settings - port 7777 must be accessible
- Verify IP address is correct (use
pingto test) - Restart both devices
- Ensure Client ID and Secret are correct
- Check that Google Drive API is enabled in Cloud Console
- Confirm your Google account has Drive access
- Check browser console for detailed error messages
- Verify sync is enabled in settings
- Check file matches your sync filter pattern
- Ensure connected devices/Google Drive account is accessible
- Check Obsidian console (Ctrl+Shift+I) for error logs
- LAN Sync: Uses plain HTTP for now. Consider using HTTPS in production
- Google Drive: Uses official OAuth 2.0 flow. Your login credentials are not stored
- Refresh Tokens: Stored locally in Obsidian data directory. Keep your device secure
- File Encryption: Consider encrypting sensitive files before syncing
Contributions are welcome! Please feel free to submit issues and pull requests.
MIT License - see LICENSE file for details
For issues, questions, or feature requests, please open an issue on GitHub.
Note: This is an early version. Please test thoroughly and backup your vault before using in production.