Calendar
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- nextjs, typescript
- Domain
- api, authentication, documentation
Research direction
No repository file, test, or documentation entry point is named. First identify where Google Calendar and Clerk authentication guidance belongs in QCX, then verify the OAuth scopes, token retrieval example, and Calendar API request are appropriate; done means the information is placed in the agreed documentation location.
Written by the indexing model from the issue text.
Description
Answer
To use Google Calendar with Clerk authentication, you need to enable Google OAuth and request the appropriate calendar scopes. (1)
Required Scopes
When configuring Google as a social connection, include these scopes to access calendar data:
- `https://www.googleapis.com/auth/calendar.readonly%60
- `https://www.googleapis.com/auth/calendar.events.readonly%60
Accessing Calendar Data
Once a user signs in with Google, Clerk stores and manages their OAuth tokens automatically. Use getUserOauthAccessToken to retrieve the access token for making Google Calendar API requests:
'use server'
import { auth, clerkClient } from '@clerk/nextjs/server'
export async function getGoogleToken() {
const { userId } = await auth()
const client = await clerkClient()
const token = await client.users.getUserOauthAccessToken(userId || '', 'oauth_google')
return {
token: token.data[0].token,
}
}
Making Calendar Requests
Use the retrieved token to call the Google Calendar API:
const client = await clerkClient()
const token = await client.users.getUserOauthAccessToken(userId, 'oauth_google')
const accessToken = token.data[0].token
// Code removed for brevity.
const response = await fetch(
`<https://www.googleapis.com/calendar/v3/calendars/$%7BencodeURIComponent(>
calendarId,
) }/events?timeMin=${monthStart.toISOString() }&timeMax=${monthEnd.toISOString() }&singleEvents=true&orderBy=startTime`,
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
},
)
Clerk automatically keeps access tokens current, so you don't need to handle token refresh manually. For a complete working example, check out the BookMate demo application or its source code on GitHub .
- Dominant language
- TypeScript
- Stars
- 19
- Forks
- 7
- Avg merge
- 59m
- Merged PRs (30d)
- 16
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QueueLab/QCX
-
Settings Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Collaboration Open
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Image preview Gen UI Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·