Calendar
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- nextjs, typescript
調査の方向性
リポジトリ内のファイル、テスト、またはドキュメントのエントリーポイントは指定されていません。まず、Google Calendar と Clerk の認証ガイダンスを QCX のどこに配置するべきかを特定し、次に OAuth スコープ、トークン取得の例、および Calendar API リクエストが適切か確認してください。情報が合意したドキュメントの場所に配置されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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 .
- 主要言語
- TypeScript
- スター
- 19
- フォーク
- 7
- 平均マージ
- 59分
- マージ済み PR(30日)
- 16
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QueueLab/QCX のほかの issue
-
Settings オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
Collaboration オープン
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
Image preview Gen UI オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
似ている issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
Mend: dependency security vulnerability untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100