DEV Community

Cover image for Creating event on google calander with google meet link.
Moin Akhter
Moin Akhter

Posted on

Creating event on google calander with google meet link.

In this tutorial, we will learn about how to create event on google calander with google meet link.

Goals
By the end of this blog you will have idea about:
How to create event on google calander.
How to inject google meet link as well.

Prerequisites

  1. You must have knowledge about javascript,nodejs and a little bit idea how does google calander apis works.
  2. You must have google admin account (We need some advance feature which can't be available in regular google account).

All code will be available on this link.
https://github.com/MOIN-AKHTAR/google-calander-event-with-meet-link

So before starting first login you google admin account as google developer account and create your project.You can create project by following these steps.

Image description

Image description

Image description

Image description

After you have created project you have to enables Google Calander APIS.You can enable by following these steps.

Image description

Image description

Image description

After you have enabled calander apis now you need to create a service account.json so that we can use that on our backend as authenticated machine/user.You can create service-account.json by following these steps.

Image description
After clicking on service account you will see below screen fill all necessary information.

Image description
After you fill all necessary info and click on done you will be redirected to a page where there will be three sections API Keys,OAuth 2.0 Client IDs and Service Accounts.Select you service-account which you have just created and go to Keys click on ADD KEY button and create this will create and download a service-account.json in your machine save this for use in our backend code.

Now after created and downloaded service-account.json file copy client_id which is in your service-account.json.Than go to google admin console and login your google admin account and follow these steps.

Image description

Image description

In above pop up image paste your client_id which you coppied from downloaded service-account.json and add https://www.googleapis.com/auth/calendar as scope in above image.

That's it that was full configuration part now let's go to coding part.

google-auth-library [For authentication purpose].
@googleapis/calendar [For calander apis purpose].
Enter fullscreen mode Exit fullscreen mode

In code i have created a createEvent function inwhich we configure everything which will create event on google calander og participants and google admin account.In this function we just authenticating ourself via service-account.json properties and than creating event with all basic info like title,description,start and endtime with participants.

SUMMARY:-
In summary what we have done first of all we created a project on google developer conolse using google admin account,enabled calander api and than created and downloaded service-account.json in our machine.After all this we log in to google admin console using google admin creds and added our service-account.json's client_id as domain wide delegation.On our backend we created a createEvent function which creating calander event and also google meet link with it.That's it happy coding...

Top comments (0)