Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Calendar

オープン
#736 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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:

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QueueLab/QCX のほかの issue

QueueLab/QCX の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。