English | 简体中文
Welcome to EdgeGPTJs, a Node.js package inspired by the Python version EdgeGPT repository. This package allows you to reverse engineer the chat feature of the new version of Bing, making it easier than ever to leverage the power of Bing's chat capabilities within your own projects.
- Reverse engineer the chat feature of the new version of Bing
- Easy-to-use API with thorough documentation
- Highly customizable and extendable
- CLI tools by demo
- exportable api by npm package
- one-click remote deployment inspired by ChatGPT-Next-Web
- integrate it with ChatGPT-Next-Web
- A Microsoft Account with early access to https://bing.com/chat (Required)
- Required in a supported country with New Bing (Chinese mainland VPN required)
-
Install the latest version of Microsoft Edge
-
Alternatively, you can use any browser and set the user-agent to look like you're using Edge (e.g.,
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51
). You can do this easily with an extension like "User-Agent Switcher and Manager" for Chrome and Firefox. -
Open bing.com/chat
-
If you see a chat feature, you are good to go
use ENVIRONMENT_VARIABLE to pass cookie jar file.
export COOKIE_FILE=/path/to/cookie.json
npx edgegptjs
or use
npx edgegptjs --cookie-file=cookie.json
To get started with EdgeGPTJs, import the package and create a new instance of Chatbot
:
const { Chatbot } = require('edgegptjs');
const bot = new Chatbot(args.cookiePath);
await bot.chatHubInitialization;
const response = await bot.ask("What's the result of 1+1?");
console.log(`Bot: ${response}`);
For a detailed explanation of the API and available methods, please refer to the documentation.
We welcome contributions from the community. If you'd like to contribute to EdgeGPTJs, please read our contributing guidelines to get started.
EdgeGPTJs is released under the MIT License.