{"id":50530635,"url":"https://github.com/monashcoding/notioncal-to-gcal","last_synced_at":"2026-06-03T13:01:43.601Z","repository":{"id":355202327,"uuid":"1221573735","full_name":"monashcoding/notioncal-to-gcal","owner":"monashcoding","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-02T10:48:46.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"fyr","last_synced_at":"2026-05-02T12:27:06.276Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monashcoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-26T11:57:52.000Z","updated_at":"2026-05-02T10:48:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/monashcoding/notioncal-to-gcal","commit_stats":null,"previous_names":["monashcoding/notioncal-to-gcal"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/monashcoding/notioncal-to-gcal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monashcoding%2Fnotioncal-to-gcal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monashcoding%2Fnotioncal-to-gcal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monashcoding%2Fnotioncal-to-gcal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monashcoding%2Fnotioncal-to-gcal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monashcoding","download_url":"https://codeload.github.com/monashcoding/notioncal-to-gcal/tar.gz/refs/heads/fyr","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monashcoding%2Fnotioncal-to-gcal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33865655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-03T13:01:42.635Z","updated_at":"2026-06-03T13:01:43.587Z","avatar_url":"https://github.com/monashcoding.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# notioncal-to-gcal\n\nAutomatically syncs events from a Notion database to a Google Calendar. You fill in events on Notion; this script keeps Google Calendar up to date automatically, running every 30 minutes. Notion is the sole source of truth — all events flow one-way from Notion into Google Calendar only.\n\n---\n\n## Prerequisites\n\n- **Node.js** v18 or later (`node --version` to check)\n- A **Notion internal integration** with read access to your database:\n  1. Go to [notion.so/my-integrations](https://www.notion.so/my-integrations) → New integration\n  2. Copy the \"Internal Integration Token\"\n  3. Open your Notion database → `...` menu → **Connections** → add your integration\n- A **Google Cloud project** with OAuth credentials:\n  1. Go to [console.cloud.google.com](https://console.cloud.google.com/) → New project\n  2. Enable the **Google Calendar API** (APIs \u0026 Services → Library)\n  3. Create **OAuth 2.0 credentials** (APIs \u0026 Services → Credentials → Create Credentials → OAuth client ID → Web application)\n  4. Add `http://localhost:3000/auth/callback` as an Authorised redirect URI\n  5. Copy the Client ID and Client Secret\n  6. Find your target **Calendar ID** in Google Calendar → Settings → your calendar → \"Calendar ID\"\n\n---\n\n## Setup\n\n```bash\n# 1. Clone and install\ngit clone \u003crepo-url\u003e\ncd notioncal-to-gcal\nnpm install\n\n# 2. Configure environment\ncp .env.example .env\n# Edit .env and fill in all six values\n\n# 3. Authorise Google Calendar (one-time only)\nnode scripts/setup-auth.js\n# Open the printed URL in your browser and grant permission\n# tokens.json will be saved automatically — stop the server with Ctrl+C\n\n# 4. Start syncing\nnode index.js\n```\n\n---\n\n## How it works\n\nEach sync run:\n1. Fetches every page from your Notion database\n2. **Creates** a Google Calendar event for any page that has never been synced\n3. **Updates** the Google event for any page that was already synced\n4. **Deletes** Google events whose Notion pages were removed or archived\n5. Skips pages with no date set (logs a warning)\n\nThe mapping between Notion page IDs and Google event IDs is stored in `sync-state.json` (never committed to git).\n\n---\n\n## Adding new Notion fields\n\nAll field translation logic lives in **`sync/mapFields.js`**. To add a new field:\n\n1. Open `sync/mapFields.js`\n2. Find the relevant `// TODO: add [field] here` comment\n3. Uncomment and adapt the example code\n4. That's it — no other files need changing\n\n---\n\n## File structure\n\n```\nindex.js                  Entry point: load tokens, start cron scheduler\nscripts/setup-auth.js     One-time Google OAuth browser flow\nauth/google.js            OAuth2 client, token helpers\nauth/notion.js            Notion client\nroutes/auth.js            Express routes for OAuth callback\nsync/fetchNotion.js       Paginated fetch from Notion database\nsync/mapFields.js         Notion page → Google Calendar event (edit to add fields)\nsync/googleCalendar.js    Google Calendar create / update / delete wrappers\nsync/stateManager.js      Load and save sync-state.json\nsync/syncRunner.js        Core sync orchestration\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonashcoding%2Fnotioncal-to-gcal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonashcoding%2Fnotioncal-to-gcal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonashcoding%2Fnotioncal-to-gcal/lists"}