A simple SDK that lets users log in with their ChatGPT account, enabling developers to integrate ChatGPT capabilities into their own applications.

Stars

305

7-day growth

No data

Forks

54

Open issues

1

License

MIT

Last updated

2026-07-11

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It provides a secure, token-free browser experience via HttpOnly cookies and integrates seamlessly with the Vercel AI SDK, while allowing users to bring their own ChatGPT subscription.

Who it is for

  • Developers building AI-powered applications
  • SaaS platforms wanting to offer ChatGPT features
  • ChatGPT power users seeking custom integrations
  • Developers using the Vercel AI SDK

Use cases

  • Building custom AI chatbots with ChatGPT models
  • Creating image generation and editing tools
  • Offering ChatGPT-based features as a service
  • Streaming AI responses directly to clients

Strengths

  • Tokens never touch the browser (HttpOnly cookie only)
  • Works out of the box with Vercel AI SDK streamText()
  • Supports image generation and editing with masks and streaming previews
  • Open source (MIT) with a well-documented quickstart and security model

Considerations

  • Requires users to have their own ChatGPT subscription
  • Node 18+ only; ESM-only packages may not suit all setups
  • Model availability depends on the user's ChatGPT account tier

README quick start

<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

Description

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

Related repositories

Similar projects matched by category, topics, and programming language.

TanStack
Featured
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 DevelopmentFrontend Frameworks
14,861
vercel-labs
Featured
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.

Developer ToolsCode Quality & Build
1,985
Jakubantalik
Featured
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 & Machine LearningAI Agents
1,191