Socket
Socket
Sign inDemoInstall

bing-chat-module

Package Overview
Dependencies
4
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bing-chat-module

Node.js client for the unofficial Bing Chat API.


Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Install size
157 kB
Created
Weekly downloads
 

Readme

Source

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:


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).


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));


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

If you found this project interesting, please consider sponsoring me or following me on twitter twitter

Keywords

FAQs

Last updated on 27 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc