Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

signin with openai

Đã đóng
#1,572 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@jherr đang làm issue này rồi.

Từ ngày 30/9/2026.

  • #1574 của @tombeckenham — đã merge

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
authentication, backend

Hướng nghiên cứu

Start by reading OpenAI's SIWC token-sharing documentation and the existing @tanstack/ai-openrouter/pkce implementation. The scope also names the BYOK keyring, the ts-react-chat BYOK key dialog, the BYOK and OpenAI adapter documentation, and unit tests for the helpers. Done means the specified sign-in, callback, token refresh, UI, docs, and tests are covered, while respecting the stated token and Responses API limits.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

has-pr waiting-on: maintainer

Add "Sign in with ChatGPT" (SIWC) to BYOK, so a user can use their ChatGPT plan instead of pasting an OpenAI API key.

OpenAI docs: https://developers.openai.com/siwc/token-sharing-open-source

Scope

  • New subpath @tanstack/ai-openai/siwc, modelled on @tanstack/ai-openrouter/pkce.
    • Start: dynamic client registration (client_id=dynamic_agent_client, agent_name_hint, persisted ext_agent_host_id), state, nonce, PKCE S256, redirect http://127.0.0.1:<port>/auth/callback.
    • Callback: check state, handle error, keep the issued client_id, exchange the code at https://auth.openai.com/api/accounts/oauth/token, check that chatgpt.tokens.use.direct was granted.
    • Refresh on the client: keep the credential (client id, refresh token, expiry) in the BYOK keyring. A helper refreshes the access token before it expires and writes it into the openai slot. The relay sees an ordinary x-byok-openai bearer value.
  • No adapter change. Docs explain the SIWC Responses limits (store: false, stream: true, no temperature/max_output_tokens/metadata/previous_response_id, no hosted tools).
  • ts-react-chat: "Continue with ChatGPT" button in the BYOK key dialog.
  • Docs: BYOK page and OpenAI adapter page. Unit tests for the helpers.

Constraints

  • OpenAI allows this only for open-source and locally hosted apps. Hosted apps need OpenAI's interest form.
  • The redirect must be 127.0.0.1 (not localhost) with the path /auth/callback.
  • Access tokens last 1 hour. Refresh tokens last 30 days and rotate on every refresh.
Ngôn ngữ chính
TypeScript
Star
3.2k
Fork
372
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
241

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/ai

Tất cả issue của TanStack/ai

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.