DHTMLX Scheduler: Two-way sync with Google Calendar (Node.js)
In this guide, you will implement two-way sync between DHTMLX Scheduler and Google Calendar in a small Node.js app:
- Load calendars and events from Google Calendar into Scheduler
- Push Scheduler create/update/delete operations back to Google Calendar
This approach implements two-way sync via API calls (Scheduler → backend → Google Calendar). It does not implement real-time Google → Scheduler push updates (webhooks). If you change events directly in Google Calendar, reload the app (or reload a date range) to see the updated data in Scheduler.
You will build:
- a Node.js + Express backend with Google OAuth 2.0 (Passport) and a small REST API for Scheduler
- an event mapping layer (Google ↔ Scheduler), including basic recurring events/exceptions handling
- a Scheduler client wired to the backend via
scheduler.createDataProcessor()
Prerequisites
- Node.js 18+
- A Google account with access to Google Cloud Console
- Basic familiarity with TypeScript and Express
- Access to DHTMLX Scheduler packages (the example uses
@dhx/trial-scheduler)
Demo repository
A complete working project that matches this guide is available on GitHub:
- https://github.com/dhtmlx/scheduler-google-auth-demo (placeholder - replace with your actual repo)
The guide explains the key steps and shows the integration code that matters. The repository is the "full runnable reference".
Project setup
In this section you will prepare Google OAuth credentials, configure the project, and run the app locally.
1) Get the project code
Do one of the following:
- Clone the repository:
git clone https://github.com/dhtmlx/scheduler-google-auth-demo.git
cd scheduler-google-auth-demo
If your project installs @dhx/* packages from the private registry, configure npm:
npm config set @dhx:registry https://npm.dhtmlx.com
2) Configure Google Cloud (OAuth 2.0)
In this step you will create OAuth credentials that the backend uses to access Google Calendar on behalf of a user.
The guide uses OAuth in Testing mode (recommended for development). In this mode, only users listed as Test users can authorize the app.