Authorizing Google Calendar w/ Clerk & Convex
Hey all -- I cloned the convex/clerk starter and am participating in the @Web Dev Cody hackathon.
I'm trying to let my users view their google calendar events on a screen. I've added the correct scopes to the custom clerk Google auth provider (https://www.googleapis.com/auth/calendar) as well as set up the correct oauth in Google cloud console.
When I set up a route handler to get the google token, and then pass it into the client component to get the calendar events i continue to get auth errors.
Is there something I'm missing? Is there documentation somewhere that better explains how to set this up? I should set it up as a private procedure right? Any help is much appreciated 🙂
4 Replies
Cool, it sounds like you need to call this
clerkClient.users.getUserOauthAccessToken()
either in Next.js or in a Convex action, then use it in the Google calendar API calls?does it matter which one?
Nope, either one works
Hey, I'm trryin something similar with gmail, to access th emails. I'm using Next and ConvexAuth. I can't find a way to get a tocken so I can call the gmail API