Google Calendar Integration
Google Calendar integration stuff - I got is working E2E with the Google account, kinda. đ
22 Replies
So this is using the OAuth method which is a browser-based flow. That doesn't make sense for our Google Calendar because it has the app acting as a user. The redacted stuff is from my personal calendar, for instance.
So what I'm doing next is trying the "API Key" method - created an API key for the public-facing calendar
Looking for a QuickStart on actually using that key for AUTH
But I'm seeing at least teh Calendar API service is activated and it works
Will stay on it
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
Itâs just something you use to anonymously read from public-facing events on the Calendar API
We want it for making a calendar page on the dev site
Showing whatâs coming up
Whatâs interesting about that is that we should probably render it server side, and kick off a new build on events change
Otherwise itâd be an unbounded bunch of client calls hitting the calendar API
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
TBD - I was hoping the Calendar API would have an event they could fire, and if not, polling for changes sounds icky
Havenât worked through that bit yet - @dayhaysoos-tbd may have in some of his early prototyping
The hack is that we donât monitor for changes at all and just kind of run the API call whenever we build anyway. Like the dev site gets several updates in the course of a week naturally
Could be another Phase /)
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
Totally - we could cron job it, even updating once an hour is totally fine
Update on Google Calendar - working through various Block processes to get a service account key added; there's a global no-no on it so will either find workaround or file us for an exception.
@dayhaysoos-tbd @leordev Google Calendar does indeed have push notifications (we can use for webhooks): https://developers.google.com/calendar/api/guides/push
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
WHO'S THE MAN?
I don't even know how to use this broken horrible excuse for a programming language and there aren't even Node APIs documented for this thing. I'm a deity.
OK I have a proposal for how to design this Calendar feature into our system:
1) Now that we're standing up server infra, we make a new service - the Calendar Service. That service is an indirection.
2) This thing runs like every 5 minutes, and hits the Google Calendar API
3) It caches the result of those queries and stores them as JSON.
4) When visitors to developer.tbd.website come to the calendar page, client side that thing hits our Calendar Service.
5) It gets the JSON from our service and renders it
That way we don't have to worry about managing events in the past, events getting stale, setting up webhooks, etc. The dev site always stays up-to-date with events within a 5 minute window and clients hit our service directly, running on Block infra just as we do for the Feedback Widget. WDYT?
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
Let's talk tomorrow đ
Shame on me for leaving messages assuming y'all'd wait until working hours đ
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
So @leordev how does SEO factor into this feature?
From the perspective of an indexing bot theyâd just be hitting developer.tbd.website
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
This is a great call-out. The social share preview link isn't working for me but I get what you're after.
Right now we're not set up for SSR and I'm not sure that's a bridge that makes sense to cross now - serving a static site with some microservices attached is a really scalable design (also takes advantage of HTTP caching and CDN layers). Going to noodle on it a bit as a quick answer isn't coming to me. If y'all have some def please raise đ
Y'all may have noticed a new repo: https://github.com/TBD54566975/google-calendar-api
This is the server indirection. I have open issues there for stuff I still need to do. But if anyone is curious to run this thing or otherwise code review my likely horrible Node code, have at it.
* You'll need to copy
.env.example
to .env
* ...and then fill it in with values I can give to any TBD employee
* Then, standard nvm use
, npm i
, and node calendar.js
to run
@leordev This is the bit we should get running on server infra once I've converted it to an Express app and filled out the README. Then @EbonyL-tbd will have cool endpoints to hit in handling the frontend piece for the dev site. I'll file a ticket for how to do that when we're live.
Also if there's a better repo name for this I'm all ears. It's obviously not a true google-calendar-api
but rather our very limited indirection which pulls N events from any Google Calendar and returns them in our own JSON format.
@EbonyL-tbd I updated the front end issue for the dev site and attached some mock data you can use to get going until we hook up the service: https://github.com/TBD54566975/developer.tbd.website/issues/340
Ping us if you have any questions and have fun with it!Thanks đđž
Unknown Userâ˘14mo ago
Message Not Public
Sign In & Join Server To View
Oh that's a good call
Thx Leo! https://github.com/TBD54566975/google-calendar-api/issues/5
just to update you guys, I'm going to get started on this next week
@EbonyL-tbd Thereâs also a service now which you can run locally and hit real endpoints
@EbonyL-tbd Wrote up a
README
for ya; lemme know if you run into issues: https://github.com/TBD54566975/google-calendar-api/blob/main/README.mdI'm getting started on this now, I'm in the dashboard but I don't have access to the API keys, can someone give me permission pls? @ALR
Absolutely! On Slack.