Turn Todoist Tasks into Public Google Calendar Events (with Google Apps Script + Sync Tokens)
Source: Dev.to
Todoist’s native integration with Google Calendar is fast, bi‑directional, and lets you manage tasks right from your calendar.
One limitation: events created by Todoist show up as private on Google Calendar. When you share your calendar, others only see generic “busy” blocks.
Full working script:
Why Make Todoist Events Public?
- Shared calendars – Colleagues or family need to see what you’re doing, not just that you’re busy.
- Multi‑account setups – Private events don’t merge nicely between work and personal calendars; public events give more context.
- Calendar delegation – Assistants or partners can plan around actual tasks and time blocks.
The script automates flipping the visibility of Todoist‑created events from private to public.
Why Not Just Use the iCal Feed?
Todoist also provides an iCal feed, which is:
- Simpler to set up
- Often already public‑like in visibility
However, the iCal feed has major drawbacks:
- One‑way (read‑only): Changes in Google Calendar don’t sync back to Todoist.
- Slow sync: Updates can be delayed by hours.
- No task completion/editing from Google Calendar.
The native integration offers:
- Bi‑directional sync (edits in Google Calendar are reflected in Todoist)
- Near real‑time updates
- Ability to complete/adjust tasks directly from Google Calendar
The script lets you keep these benefits while making events public.
How the Script Works
The script (see the Gist) uses Google’s Calendar Advanced Service and sync tokens:
- Automatically finds your “Todoist” calendar.
- First run: Fetches events from the last 30 days and changes private → public.
- Subsequent runs: Uses the sync token to retrieve only new or modified events.
- Efficient: No full calendar scans after the initial run.
- Future‑dated tasks: Even events scheduled years ahead are processed immediately when created.
Quick Setup (≈5 minutes)
- Go to New project.
- Add service: Resources → Advanced Google services → enable Google Calendar API.
- Copy the script from the Gist and paste it into
Code.gs. - Run
updateTodoistEvents()once to authorize the script. - Add a trigger: Time‑driven, every 10‑15 minutes.
Now new Todoist events become public automatically.
Troubleshooting
| Problem | Solution |
|---|---|
| “Todoist calendar not found” | Update the calendar name in the script: cal.summary === 'YourCalendarName'. |
| “API call failed” | Ensure the Google Calendar API is enabled in Advanced services. |
| Sync token errors | The script automatically resets invalid tokens; re‑run the function if needed. |
When This Makes Sense
Use this solution if:
✓ You use the native Todoist ↔ Google Calendar integration
✓ You share your calendar and want visible task details
✓ You need bi‑directional, real‑time sync
✓ You prefer a set‑and‑forget Apps Script solution
Full Script and Updates
The complete script and future updates are available at:
Feel free to star, fork, or share tweaks (e.g., filtering by project or custom calendar names) in the comments.