{"_id":"@opencoredev/loginwithchatgpt-core","_rev":"3-23e42d887da8c78cc2d337d73ee6142a","name":"@opencoredev/loginwithchatgpt-core","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@opencoredev/loginwithchatgpt-core","version":"0.1.0","keywords":["chatgpt","openai","oauth","codex","login","auth","device-code"],"license":"MIT","_id":"@opencoredev/loginwithchatgpt-core@0.1.0","maintainers":[{"name":"leoisadev","email":"leoplayz317@gmail.com"}],"homepage":"https://github.com/opencoredev/login-with-chatgpt#readme","bugs":{"url":"https://github.com/opencoredev/login-with-chatgpt/issues"},"dist":{"shasum":"2b8834cb32bf8a6689aa25287c02d0e1ad5fd506","tarball":"https://registry.npmjs.org/@opencoredev/loginwithchatgpt-core/-/loginwithchatgpt-core-0.1.0.tgz","fileCount":41,"integrity":"sha512-EASrveJnDis8fxM0senJX/5naTmq38cLrDqsge7iO6yHeNJhK6bKY7vRnSy9zHFpsxWfGOIsproSkggCMKHJwA==","signatures":[{"sig":"MEUCIQCelEYU8eSGvmb67UZCjYc0ZDFRYxSrikcjVt5opW0rCAIgD8851fjLCd8B2J5mpzyF+2Vb4FxNkgjuiE7Ghtq/bX4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":98433},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"bun":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"49f26ca0e5a53efe6ed808ed08528564610c3e7b","scripts":{"test":"bun test","build":"tsc -p tsconfig.build.json","prepublishOnly":"rm -rf dist && bun run build"},"_npmUser":{"name":"leoisadev","email":"leoplayz317@gmail.com"},"repository":{"url":"git+https://github.com/opencoredev/login-with-chatgpt.git","type":"git","directory":"packages/core"},"_npmVersion":"11.16.0","description":"Framework-agnostic engine for Login with ChatGPT: OAuth device-code + PKCE flows, token refresh, and the Codex responses transport.","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/loginwithchatgpt-core_0.1.0_1783482870751_0.3425089099366676","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@opencoredev/loginwithchatgpt-core","version":"0.1.1","keywords":["chatgpt","openai","oauth","codex","login","auth","device-code"],"license":"MIT","_id":"@opencoredev/loginwithchatgpt-core@0.1.1","maintainers":[{"name":"leoisadev","email":"leoplayz317@gmail.com"}],"homepage":"https://github.com/opencoredev/login-with-chatgpt#readme","bugs":{"url":"https://github.com/opencoredev/login-with-chatgpt/issues"},"dist":{"shasum":"daccff3784dd2f8a2989bb4e99f35bcdc3f63457","tarball":"https://registry.npmjs.org/@opencoredev/loginwithchatgpt-core/-/loginwithchatgpt-core-0.1.1.tgz","fileCount":41,"integrity":"sha512-ev23J6Kh3ofaVIzbgLtYA1CJ9eNBGDJoRB9QWsYxGZ+E/zJdD6u2e+NoHRkgtwxCCaAoyAkZpT+WgMT7D65f3Q==","signatures":[{"sig":"MEUCIQC5Ep3p15qsyhfOMGYUOZ/CWBSz5+Z8rC95wWMjHmFtfQIgBWU/nwu+vm6l+iUvrkHtFB7EFq3DUYP7SNt5sWvad90=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":98415},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"bun":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"6ff833d604cb154ccbb8c90e9169aa86600ce1b4","scripts":{"test":"bun test","build":"tsc -p tsconfig.build.json","prepublishOnly":"rm -rf dist && bun run build"},"_npmUser":{"name":"leoisadev","email":"leoplayz317@gmail.com"},"repository":{"url":"git+https://github.com/opencoredev/login-with-chatgpt.git","type":"git","directory":"packages/core"},"_npmVersion":"11.16.0","description":"Framework-agnostic engine for Login with ChatGPT: OAuth device-code + PKCE flows, token refresh, and the Codex responses transport.","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/loginwithchatgpt-core_0.1.1_1783484150183_0.1648929782176778","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@opencoredev/loginwithchatgpt-core","version":"0.2.0","description":"Framework-agnostic engine for Login with ChatGPT: OAuth device-code + PKCE flows, token refresh, and the Codex responses transport.","type":"module","license":"MIT","exports":{".":{"bun":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.build.json","test":"bun test","prepublishOnly":"rm -rf dist && bun run build"},"keywords":["chatgpt","openai","oauth","codex","login","auth","device-code"],"sideEffects":false,"engines":{"node":">=18"},"repository":{"type":"git","url":"git+https://github.com/opencoredev/login-with-chatgpt.git","directory":"packages/core"},"homepage":"https://github.com/opencoredev/login-with-chatgpt#readme","bugs":{"url":"https://github.com/opencoredev/login-with-chatgpt/issues"},"publishConfig":{"access":"public"},"gitHead":"3e1a91a08f1d0d150f996ab3124c5f3c6dd5f7b8","_id":"@opencoredev/loginwithchatgpt-core@0.2.0","_nodeVersion":"26.3.1","_npmVersion":"11.16.0","dist":{"integrity":"sha512-PRzUWEYJepxkcYVvk/Uc7bc8YfUr50PWqNMjfNs/AZOF6/H73QykzFhjZJIG5cphIKrNdjOmvofuy25cH1F8ow==","shasum":"a9427c1936d18b744e960922bc8c393089292e76","tarball":"https://registry.npmjs.org/@opencoredev/loginwithchatgpt-core/-/loginwithchatgpt-core-0.2.0.tgz","fileCount":41,"unpackedSize":98466,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAlPEHTWESI/Zs/aCy0euyWj62Idji8KYkPLPTanB+xpAiBnsByOOV6U2LyftqLuHvQeAovHFl0pG9g+1tn+lkuTCw=="}]},"_npmUser":{"name":"leoisadev","email":"leoplayz317@gmail.com"},"directories":{},"maintainers":[{"name":"leoisadev","email":"leoplayz317@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/loginwithchatgpt-core_0.2.0_1783524655251_0.08675665430390911"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T03:54:30.569Z","modified":"2026-07-08T15:30:55.537Z","0.1.0":"2026-07-08T03:54:30.925Z","0.1.1":"2026-07-08T04:15:50.386Z","0.2.0":"2026-07-08T15:30:55.395Z"},"bugs":{"url":"https://github.com/opencoredev/login-with-chatgpt/issues"},"license":"MIT","homepage":"https://github.com/opencoredev/login-with-chatgpt#readme","keywords":["chatgpt","openai","oauth","codex","login","auth","device-code"],"repository":{"type":"git","url":"git+https://github.com/opencoredev/login-with-chatgpt.git","directory":"packages/core"},"description":"Framework-agnostic engine for Login with ChatGPT: OAuth device-code + PKCE flows, token refresh, and the Codex responses transport.","maintainers":[{"name":"leoisadev","email":"leoplayz317@gmail.com"}],"readme":"# @opencoredev/loginwithchatgpt-core\n\nFramework-agnostic engine for [Login with ChatGPT](../../README.md).\n\nUse this package directly when you are building a custom backend, CLI, storage\nadapter, or transport. Most apps should start with `@opencoredev/loginwithchatgpt-server`.\n\n```ts\nimport {\n  listCodexModels,\n  requestDeviceCode,\n  resolveConfig,\n  waitForDeviceTokens,\n} from \"@opencoredev/loginwithchatgpt-core\";\n\nconst config = resolveConfig();\nconst device = await requestDeviceCode(config);\n\nconsole.log(`Open ${device.verificationUrl} and enter ${device.userCode}`);\n\nconst tokens = await waitForDeviceTokens(config, device);\nif (!tokens.accountId) throw new Error(\"Missing ChatGPT account id.\");\n\nconst models = await listCodexModels({\n  config,\n  getAuth: () => ({\n    accessToken: tokens.accessToken,\n    accountId: tokens.accountId,\n  }),\n});\n```\n\n## Main exports\n\n| Area | Exports |\n| --- | --- |\n| Device flow | `requestDeviceCode`, `pollDeviceCode`, `waitForDeviceTokens`, `exchangeDeviceAuthorization` |\n| PKCE flow | `createAuthorizationUrl`, `exchangeAuthorizationCode`, `generatePkce`, `createState` |\n| Tokens | `ensureFreshTokens`, `isAccessTokenExpired`, `refreshTokens` |\n| Identity | `parseUser`, `deriveAccountId`, `decodeJwt`, `getTokenExpiry` |\n| Transport | `createCodexFetch`, `normalizeResponsesBody`, `listCodexModels`, `extractCodexModelSlugs` |\n| Storage | `KeyValueStore`, `MemoryStore` |\n| Config/errors | `resolveConfig`, `ChatGPTConfig`, `ChatGPTAuthError` |\n\nSee the root README and docs site for production notes.\n","readmeFilename":"README.md"}