Skip to content

Commit 0b605c0

Browse files
docs: update readme instructions
1 parent a4ed68b commit 0b605c0

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

readme.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ npm install chatgpt puppeteer
5858
import { ChatGPTAPI, getOpenAIAuth } from 'chatgpt'
5959

6060
async function example() {
61-
// uses puppeteer to bypass cloudflare (headful because you may have to solve
62-
// a captcha)
61+
// use puppeteer to bypass cloudflare (headful because of captchas)
6362
const openAIAuth = await getOpenAIAuth({
6463
email: process.env.EMAIL,
6564
password: process.env.EMAIL
@@ -174,19 +173,22 @@ You can also get these tokens manually, but keep in mind that the `clearanceToke
174173
<details>
175174
<summary>Getting tokens manually</summary>
176175

177-
To get a session token manually:
176+
To get session token manually:
178177

179178
1. Go to https://chat.openai.com/chat and log in or sign up.
180179
2. Open dev tools.
181180
3. Open `Application` > `Cookies`.
182181
![ChatGPT cookies](./media/session-token.png)
183182
4. Copy the value for `__Secure-next-auth.session-token` and save it to your environment. This will be your `sessionToken`.
184183
5. Copy the value for `cf_clearance` and save it to your environment. This will be your `clearanceToken`.
184+
6. Copy the value of the `user-agent` header from any request in your `Network` tab. This will be your `userAgent`.
185+
186+
Pass `sessionToken`, `clearanceToken`, and `userAgent` to the `ChatGPTAPI` constructor.
185187

186188
</details>
187189

188190
> **Note**
189-
> This package will switch to using the official API once it's released.
191+
> This package will switch to using the official API once it's released, which will make this process much simpler.
190192
191193
#### Restrictions
192194

@@ -254,15 +256,14 @@ If you create a cool integration, feel free to open a PR and add it to the list.
254256
This package is ESM-only. It supports:
255257

256258
- Node.js >= 18
257-
- Node.js 17, 16, and 14 were supported in earlier versions, but OpenAI's Cloudflare update caused a bug with `undici` on v17 and v16 that we need to debug. So for now, use `node >= 18`
258-
- We recommend against using `chatgpt` from client-side browser code because it would expose your private session token
259-
- If you want to build a website using `chatgpt`, we recommend using it only from your backend API
259+
- Node.js 17, 16, and 14 were supported in earlier versions, but OpenAI's Cloudflare update caused a bug with `undici` on v17 and v16 that needs investigation. So for now, use `node >= 18`
260+
- We recommend against using `chatgpt` from client-side browser code because it would expose your private session token
261+
- If you want to build a website using `chatgpt`, we recommend using it only from your backend API
260262

261263
## Credits
262264

263-
- Huge thanks to [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors 💪
265+
- Huge thanks to [@wong2](https://github.com/wong2), [@simon300000](https://github.com/simon300000), [@RomanHotsiy](https://github.com/RomanHotsiy), [@ElijahPepe](https://github.com/ElijahPepe), and all the other contributors 💪
264266
- The original browser version was inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross)
265-
- The original REST version was inspired by [chat-gpt-google-extension](https://github.com/wong2/chat-gpt-google-extension) by [@wong2](https://github.com/wong2)
266267
- [OpenAI](https://openai.com) for creating [ChatGPT](https://openai.com/blog/chatgpt/) 🔥
267268

268269
## License

0 commit comments

Comments
 (0)