Programmatically create and manage Google Meet meetings using the Google Meet API with service account authentication and domain-wide delegation.
- A Google Workspace account with admin access
- Node.js 18+ and pnpm
- A service account with domain-wide delegation enabled
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Meet API
- Create a service account:
- Go to IAM & Admin → Service Accounts
- Click Create Service Account
- Download the JSON key file and save it as
service-account.jsonin the project root
- In the service account details, click Show Advanced Settings
- Copy the Client ID
- Go to your Google Workspace Admin Console
- Navigate to Security → API Controls → Domain-wide Delegation
- Click Add new and paste the Client ID
- Add these OAuth scopes:
https://www.googleapis.com/auth/meetings.space.created https://www.googleapis.com/auth/meetings.space.readonly
-
Install dependencies:
pnpm install
-
Create a
.envfile in the project root:cp .env.example .env
-
Edit
.envand set theIMPERSONATED_USERvariable with a real user email from your domain:This user must exist in your Google Workspace domain and will be the owner of the created meetings.
npm run createThis creates a new Google Meet and stores the meeting ID in .space file.
npm run getThis reads the meeting ID from .space and fetches the meeting details.