{"_id":"@abdalsalaam/chatgpt-wp-connect","name":"@abdalsalaam/chatgpt-wp-connect","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@abdalsalaam/chatgpt-wp-connect","version":"0.1.0","description":"Local OAuth helper for the WordPress 'AI Provider for ChatGPT' plugin. Runs the Codex-style PKCE flow on your laptop and posts the resulting tokens back to your WordPress site.","bin":{"chatgpt-wp-connect":"index.js"},"main":"index.js","type":"commonjs","engines":{"node":">=18"},"keywords":["wordpress","chatgpt","openai","oauth","pkce","codex"],"license":"GPL-2.0-or-later","author":{"name":"Abdalsalaam Halawa","url":"https://halawa.io"},"repository":{"type":"git","url":"git+https://github.com/Abdalsalaam/chatgpt-wp-connect.git"},"bugs":{"url":"https://github.com/Abdalsalaam/chatgpt-wp-connect/issues"},"homepage":"https://github.com/Abdalsalaam/chatgpt-wp-connect#readme","scripts":{"prepublishOnly":"node -c index.js"},"publishConfig":{"access":"public"},"gitHead":"67c9af9cffee213af0cbe14bb72af3a33f20c02b","_id":"@abdalsalaam/chatgpt-wp-connect@0.1.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-vqw+fgMc8UbWwO7oHQdDMD2xAsa1yShDAPWiakEZPVfnM4o41mtOdkrm4YaFyVQjJOLuEzqdExNqOG6NLfwDAQ==","shasum":"0a06506224b796d109d0cf0b30faea369a30f86a","tarball":"https://registry.npmjs.org/@abdalsalaam/chatgpt-wp-connect/-/chatgpt-wp-connect-0.1.0.tgz","fileCount":4,"unpackedSize":31635,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC/J6aIX+krIczfJD/ga6iG0urabd6CmCsIZMqsVpxUgAIgKlHLvYu17dayMBCniJGZA811g605ogj3cg6KcslFInc="}]},"_npmUser":{"name":"abdalsalaam","email":"abdalsalaamnafez@gmail.com"},"directories":{},"maintainers":[{"name":"abdalsalaam","email":"abdalsalaamnafez@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chatgpt-wp-connect_0.1.0_1779500461195_0.9089802215254992"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-23T01:41:01.033Z","0.1.0":"2026-05-23T01:41:01.337Z","modified":"2026-05-23T01:41:01.589Z"},"maintainers":[{"name":"abdalsalaam","email":"abdalsalaamnafez@gmail.com"}],"description":"Local OAuth helper for the WordPress 'AI Provider for ChatGPT' plugin. Runs the Codex-style PKCE flow on your laptop and posts the resulting tokens back to your WordPress site.","homepage":"https://github.com/Abdalsalaam/chatgpt-wp-connect#readme","keywords":["wordpress","chatgpt","openai","oauth","pkce","codex"],"repository":{"type":"git","url":"git+https://github.com/Abdalsalaam/chatgpt-wp-connect.git"},"author":{"name":"Abdalsalaam Halawa","url":"https://halawa.io"},"bugs":{"url":"https://github.com/Abdalsalaam/chatgpt-wp-connect/issues"},"license":"GPL-2.0-or-later","readme":"# @abdalsalaam/chatgpt-wp-connect\n\nLocal OAuth helper for the WordPress [AI Provider for ChatGPT](https://github.com/Abdalsalaam/ai-provider-for-chatgpt) plugin. Runs the Codex CLI–style PKCE flow on your laptop and posts the resulting tokens to your WordPress site so you don't have to copy `~/.codex/auth.json` by hand.\n\n## Usage\n\nIn your WordPress admin: **Settings → ChatGPT → Connect with ChatGPT**. The page shows a one-line command — copy and run it on your laptop:\n\n```bash\nnpx @abdalsalaam/chatgpt-wp-connect https://your-site.example a1b2c3...64hex\n```\n\nYour default browser opens to OpenAI's sign-in page. Approve, and the WordPress tab connects automatically.\n\n## Requirements\n\n- Node.js 18 or newer.\n- Port `1455` (or `1457` as fallback) free on `127.0.0.1`.\n- A reachable WordPress site running the `ai-provider-for-chatgpt` plugin ≥ 0.3.0.\n\n## What it does\n\n1. Generates a PKCE code_verifier / code_challenge (S256, per RFC 7636).\n2. Binds a one-shot HTTP listener on `127.0.0.1:1455` (fallback `1457`) at `/auth/callback`.\n3. Opens `https://auth.openai.com/oauth/authorize?...` in your default browser, using the public Codex CLI client id (`app_EMoamEEZ73f0CkXaXp7hrann`).\n4. Receives the `code` on the local listener, then POSTs to `https://auth.openai.com/oauth/token` with `grant_type=authorization_code` and the PKCE verifier.\n5. Extracts the `chatgpt_account_id` claim from the returned `id_token`.\n6. POSTs `{ token, bundle }` to `<your-site>/wp-json/ai-provider-for-chatgpt/v1/connection/pair`. The plugin validates the one-time pairing token, then stores the encrypted bundle.\n\nThe pairing token issued by the WordPress UI is single-use and expires after 10 minutes.\n\n## Security notes\n\n- Tokens never leave your machine and your WordPress server.\n- The OAuth flow is identical to `codex login`; this CLI does not see your password.\n- The pairing endpoint on WordPress is public but accepts only a 64-character hex token issued seconds earlier by a logged-in admin.\n\n## License\n\nGPL-2.0-or-later\n","readmeFilename":"README.md","_rev":"1-68c3b16452a3e2f8e8e20a3e861b8492"}