bing-chat-module
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

# bing-chat Module

## Description

This module is a Node.js client for the unofficial Bing Chat API. This module allows you to interact with Bing Chat using Node.js.

## Installation

Before using this module, make sure you have installed Node.js on your computer. To install the module, use the following command:

```bash

npm install bing-chat

```

Make sure you use `node >= 18` so that `fetch` is available.

## Usage

**You need access to Bing Chat OR a valid cookie from someone who has access**.

The cookie you need from Bing is the `_U` cookie (or just all of the cookies concatenated together; both will work).

``` Nodejs

const { BingChat } = require('bing-chat-module');

const bingChatInstance = new BingChat({ cookie: 'your_bing_cookie_here' });

bingChatInstance.sendMessage('Hello, Bing Chat!')
.then(response => console.log(response))
.catch(error => console.error(error));

```

``` Make A New Conversation

bingChatInstance.createConversation()
.then(result => console.log(result))
.catch(error => console.error(error));

```

## How to Take Cookies

1. Open a browser and go to Bing.com

2. Open a browser and visit Bing.com.
-> Login to your Microsoft Account

3. Login to your Microsoft account. Make sure you are logged in before continuing.
-> Open Developer Tools (Ctrl + Shift + I or F12)

4. Open Developer Tools in your browser. This can be done by pressing Ctrl + Shift + I or F12.
-> Go to Network Tab

5. Select the "Network" tab in Developer Tools.
-> Search Request to www.bing.com

6. Reload the Bing.com page and observe the request on the Network tab.
-> Look for Cookies in the Request Header

7. Select the request to www.bing.com and see the "Headers" section. Look for the "Cookie" section in the request header.
-> Copy Cookies

8. Copy the cookie value from the request header. This is what you will use as the cookie value when creating the BingChat object.

## Credit

Thanks to KimzzDev

## License

MIT © [Travis Fischer](https://transitivebullsh.it)

If you found this project interesting, please consider [sponsoring me](https://github.com/sponsors/transitive-bullshit) or <a href="https://twitter.com/transitive_bs">following me on twitter <img src="https://storage.googleapis.com/saasify-assets/twitter-logo.svg" alt="twitter" height="24px" align="center"></a>

Package Sidebar

Install

npm i bing-chat-module

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

19.4 kB

Total Files

5

Last publish

Collaborators

  • kimzz