Creating event on google calander with google meet link.
Tags: node, calander, googlemeet, javascript
Published: 2023-08-05 15:06:11

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1b16l67mzdc3wlxhfkh3.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jxpzrne4hbquh86gxk7x.PNG)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa2p86dxlcna2hsuk0zi.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rkxe9a4m7tkfanli2tf9.PNG)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16jqn845kma62zx53u9t.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtuy9mlz814jgb2wlplk.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbt0mhb0bnt1hkmzn64b.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwid5w36nziyjm0i4j5t.png)
After clicking on service account you will see below screen fill all necessary information.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ootf7krabryizvrqkkeh.PNG)
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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylu76ix2a95c7fmclyrn.PNG)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3k6j2c4t8bisobx02oem.png)

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].
```
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...