Seamlessly integrate your Google Calendar with your notes. Quickly insert calendar events with intelligent type-ahead search.
- Quick Access: Type
:in any note to trigger the calendar event picker - Smart Filtering: Type
:meetingto instantly filter events containing "meeting" - Multi-field Search: Searches across event titles, descriptions, locations, and attendees
- Rich Event Display: View event details including date, time, location, and video conferencing links
- One-Click Insert: Select an event to insert it as a clickable link in your note
- In-app Creation: Create new calendar events without leaving Obsidian
- Event Details: Add title, date, time, description, and all-day event support
- Instant Link: Automatically inserts a link to the newly created event
- Flexible Expiry: Choose from 1 week, 1 month, 3 months, 6 months, or unlimited
- Unlimited Access: Set token to never expire until manually disconnected
- Visual Status: Real-time token status display in settings
- Auto-validation: Automatic token validation before every API call
- Clear Notifications: Get notified when tokens expire and need reconnection
- 5-Minute Cache: Reduces API calls with intelligent event caching
- Background Sync: Option to manually sync your calendar
- Configurable Range: Set custom time range for event suggestions (default: 90 days)
- Open Settings
- Navigate to Community Plugins
- Search for "Pick Google Calendar"
- Click Install
- Enable the plugin
- Download the latest release from GitHub Releases
- Extract the files to your vault's
.obsidian/plugins/pick-google-calendar/folder - Reload
- Enable the plugin in Settings → Community Plugins
- Go to Google Cloud Console
- Click "Select a project" → "New Project"
- Give it a name (e.g., "Pick Google Calendar Plugin") and click "Create"
- In the sidebar, go to "APIs & Services" → "Library"
- Search for "Google Calendar API"
- Click on it and press "Enable"
-
Go to "APIs & Services" → "Credentials"
-
Click "Create Credentials" → "OAuth client ID"
-
If prompted, configure the OAuth consent screen first:
- User Type: External
- Add your email as a test user
- Scopes: Add
calendar.readonlyandcalendar.events
-
Select "Web application" as the application type
-
Add this Authorized redirect URI:
https://rajeevrajchal.github.io/pmc-google/oauth-callback -
Click "Create" and copy your Client ID
- Open Settings → Pick Google Calendar
- Paste your Client ID
- Configure token expiry (default: Unlimited)
- Set your preferred time range for suggestions (default: 90 days)
- Click "Connect to Google"
- Authorize the application in your browser
- Return - you're ready to go!
- In any note, type
: - A suggestion menu appears showing your upcoming events
- Select an event to insert it as a link:
[Event Name](Google Calendar Link)
- Type
:followed by your search query - Example:
:team meetingfilters events containing "team meeting" - The search works across:
- Event titles
- Descriptions
- Locations
- Attendee names and emails
- Type
:to open the event picker - Select "+ Create new event" at the top
- Fill in event details:
- Title (required)
- Date (required)
- All-day toggle
- Start/End time (for timed events)
- Description (optional)
- Click "Create Event"
- The event link is automatically inserted in your note
Choose how long your Google Calendar connection remains active:
- 1 Week: Token expires after 7 days
- 1 Month: Token expires after 30 days
- 3 Months: Token expires after 90 days
- 6 Months: Token expires after 180 days
- Unlimited: Token never expires (until manually disconnected)
Configure how far into the past and future to search for events:
- Default: 90 days
- Searches 7 days in the past
- Searches N days into the future (configurable)
Visual indicator showing:
- ✅ Token valid for X days
- ✅ Token valid: Unlimited
⚠️ Token expires in X days (within 24 hours)⚠️ Token expired (reconnection required)
- TypeScript: Full type safety and modern JavaScript features
- Google Calendar API: Direct communication with Google Calendar
- esbuild: Fast bundling and development workflow
pmc/
├── src/
│ ├── main.ts # Plugin entry point
│ ├── components/
│ │ ├── event-suggestion.ts # Type-ahead event picker
│ │ ├── create-event.ts # Event creation modal
│ │ ├── setting.ts # Settings tab
│ │ └── tabs/
│ │ └── google/
│ │ ├── auth.ts # OAuth flow
│ │ ├── calendar-api.ts # Google Calendar API client
│ │ ├── token-manager.ts# Token validation & expiry
│ │ ├── settings-ui.ts # Settings UI components
│ │ └── types.ts # TypeScript interfaces
│ └── style.css # Custom styles
├── server/
│ └── oauth-server.ts # OAuth callback handler
├── manifest.json # Plugin metadata
├── package.json # Dependencies
└── esbuild.config.mjs # Build configuration
- Triggers on
:character - Real-time query filtering with regex pattern matching
- 5-minute cache for API responses
- Multi-field search (title, description, location, attendees)
- RESTful API client for Google Calendar
- Automatic token validation before each request
- Methods:
fetchEvents,createEvent,updateEvent,deleteEvent,listCalendars,syncCalendar - Error handling with user-friendly notices
- Calculates expiry dates based on user settings
- Validates tokens before API calls
- Provides human-readable time remaining
- Supports unlimited (never expiring) tokens
- Implements OAuth 2.0 implicit flow
- Redirects to hosted callback page
- Uses
obsidian://protocol handler - Stores access token securely in plugin settings
pnpm install
pnpm run dev- Watches for file changes
- Enables source maps
- No minification
- Hot reload support
pnpm run build- TypeScript compilation with type checking
- esbuild bundling
- Tree shaking for smaller bundle size
- Minification
- Outputs to
main.js
- Target: ES2018
- Format: CommonJS
- Entry:
src/main.ts - Output:
main.js - Minify: Production only
- No Data Storage: Events are cached locally for 5 minutes only
- OAuth 2.0: Industry-standard authentication
- Token Control: Full control over token expiry
- Scopes: Only requests necessary permissions:
calendar.readonly: Read calendar eventscalendar.events: Create and modify events
- No Tracking: No analytics or data collection
Problem: "Failed to connect" error
- Solution: Verify Client ID is correct
- Solution: Ensure redirect URI is added to Google Cloud Console
- Solution: Check OAuth consent screen configuration
Problem: "Token has expired" notification
- Solution: Go to Settings → Pick Google Calendar
- Solution: Click "Disconnect" then "Connect to Google"
- Solution: Consider setting token expiry to "Unlimited"
Problem: Event picker shows no results
- Solution: Check if events exist in the time range (Settings → Suggestion Time Range)
- Solution: Click "Sync Calendar" in settings
- Solution: Try typing
:without query to see all events
Problem: "Failed to fetch events" error
- Solution: Check internet connection
- Solution: Verify Google Calendar API is enabled
- Solution: Try reconnecting your account
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
# Clone repository
git clone https://github.com/rajeevrajchal/pmc-google.git
cd pmc
# Install dependencies
pnpm install
# Start development
pnpm run dev
# Run linting
pnpm run lintIf you find this plugin helpful, consider supporting the development:
This project is licensed under the ISC License - see the LICENSE file for details.
Rajeev Rajchal
- Website: rajeevrajchal.com.np
- GitHub: @rajeevrajchal
- Initial release
- Type-ahead event search with
:trigger - Multi-field search (title, description, location, attendees)
- Create new calendar events
- Flexible token expiry options (1 week to unlimited)
- Automatic token validation
- 5-minute event caching
- Configurable time range for suggestions
- Rich event display with dates, times, and conference links
Made with ❤️ for the community