Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bing-chat-module

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bing-chat-module

Node.js client for the unofficial Bing Chat API.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 27 Dec 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc