一个让用户通过 ChatGPT 账号登录的简单 SDK,帮助开发者在自己的应用中集成 ChatGPT 功能。

Stars

305

7 天增长

暂无数据

Fork 数

54

开放 Issue

1

开源协议

MIT

最近更新

2026-07-11

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过 HttpOnly Cookie 实现安全的无令牌浏览器体验,并与 Vercel AI SDK 无缝集成,同时允许用户自带 ChatGPT 订阅。

适合谁使用

  • 构建 AI 驱动的应用的开发者
  • 希望提供 ChatGPT 功能的 SaaS 平台
  • 寻求自定义集成的 ChatGPT 重度用户
  • 使用 Vercel AI SDK 的开发者

典型使用场景

  • 构建基于 ChatGPT 模型的自定义聊天机器人
  • 创建图片生成与编辑工具
  • 以服务形式提供 ChatGPT 功能
  • 将 AI 响应直接流式传输到客户端

项目优势

  • 令牌永不接触浏览器(仅使用 HttpOnly Cookie)
  • 与 Vercel AI SDK 的 streamText() 开箱即用
  • 支持带遮罩和流式预览的图片生成与编辑
  • 开源(MIT 协议),提供详细的快速启动文档和安全模型

使用前须知

  • 要求用户拥有自己的 ChatGPT 订阅
  • 仅支持 Node 18+,ESM 只打包可能不适用于所有环境
  • 模型可用性取决于用户 ChatGPT 账号的等级

README 快速开始

<LoginWithChatGPT />

A simple SDK that lets your users log in with their ChatGPT account.

  • Users bring their own ChatGPT subscription
  • Tokens never touch the browser: HttpOnly cookie only
  • Works with the Vercel AI SDK: streamText() straight from the client
  • Generates and edits images with size, quality, format, masks, and streaming previews
  • Open source, MIT licensed

The handler keeps tokens behind the proxy path by default. The browser gets a session cookie, asks your backend which models the account has, and streams from there.

Install

bun add @opencoredev/loginwithchatgpt-server @opencoredev/loginwithchatgpt-react @opencoredev/loginwithchatgpt-ai

npm and pnpm work too. Everything ships as ESM with types for Node 18+.

Packages

PackageDoes
@opencoredev/loginwithchatgpt-coreOAuth, token refresh, model discovery
@opencoredev/loginwithchatgpt-serverBackend handler: login, session, logout, models, responses proxy
@opencoredev/loginwithchatgpt-reactThe `` button and hook
@opencoredev/loginwithchatgpt-aiVercel AI SDK providers

Docs

Start with the quickstart. The security model explains how tokens stay on your server, and the production checklist is there for when you deploy.

Agent skill

Using Claude Code, Cursor, or Codex? Install the agent skill so your agent wires the SDK correctly: no invented API keys, and no assuming one model slug works for every account.

npx skills add opencoredev/login-with-chatgpt

Then just ask your agent to "add Login with ChatGPT" and it will mount the handler, render the button, and stream through the proxy the right way. Also on skills.sh.

Star history

MIT License · Built by @leodev

项目描述

A simple SDK that lets your users log in with their ChatGPT account.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

TanStack
精选
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web 开发前端框架
14,861
vercel-labs
精选
vercel-labs GitHub avatar

scriptc

scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

开发者工具代码质量与构建
1,985
Jakubantalik
精选
Jakubantalik GitHub avatar

thinking-orbs

A React component library that renders six hand-tuned animated thought orb loading indicators on a plain 2D canvas, with two purpose-tuned sizes and automatic theme detection for AI and agent UIs.

AI 与机器学习AI 智能体
1,191