I want to use google calendar api as library in Next.js without using _document.tsx. In that case, I have come up with 2 ways which might be possible as below;
- Use google calendar api for JavaScript with npm install
- Use google calendar api for node.js in browser in Next.js
Regarding 1, there is seemingly no ways to npm install xxx in the official site here, but <script src="https://apis.google.com/js/api.js"></script> is said to use. This is not what I wanted because I use Next.js so I wanna use this library using npm install.
As for method 2, npm install googleapi is introduced on the official site here, but I'm still concerned that it may only work on the server side. Since I am creating a dashboard-like site, I want to call the API from the client side (browser) when users request their dashboard, so if I can only run it on the server side, it will be a problem for me!
Anyone can answer that??