npm package: @neelegirl/baileys
Description: Conservative Neelegirl-maintained CommonJS WhatsApp Web client based on WhiskeySockets/Baileys with preserved QR, NEELE message IDs and device/LID handling.
Author: Neele
Latest version: 2.2.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @neelegirl/baileys

![Neelegirl Baileys](https://files.catbox.moe/phppor.JPG)

Conservative Neelegirl-maintained CommonJS WhatsApp Web client based on WhiskeySockets/Baileys, prepared for local use and publish review without removing project-specific behavior.

## Reference Status

- Public reference checked on 2026-03-20 against `WhiskeySockets/Baileys` `master`
- Reference HEAD: `d0779026958ca607e4efd4abef8ba89d581e7027`
- Public upstream package version at that snapshot: `7.0.0-rc.9`

This package is not a blind mirror of upstream. It intentionally keeps Neelegirl-specific runtime behavior and CommonJS packaging where that is required for compatibility with the local stack.

## What Was Explicitly Preserved

- QR code flow and terminal QR handling
- `NEELE` message-ID special handling
- Neelegirl-specific device and message labeling behavior
- Existing WhatsApp Web focused socket defaults and event flow
- Legacy auth helpers already shipped in this package:
  `useMultiFileAuthState`, `useSingleFileAuthState`, `useMongoFileAuthState`
- Existing store helpers already shipped in this package:
  `makeInMemoryStore`, `makeCacheManagerStore`

## What Was Updated Conservatively In 2.2.0

- Fixed WA Web version fetching so `fetchLatestWaWebVersion()` can parse `sw.js` correctly
- Preserved the `NEELE` message-ID path while correcting helper edge cases
- Forwarded alternative addressing fields more cleanly in decoded message keys:
  `remoteJidAlt`, `participantAlt`, `addressingMode`
- Hardened LID migration calls so custom repositories do not fail noisily
- Cleaned publish metadata:
  recursive `files`, explicit `exports`, corrected package description
- Rewrote the README to match the code that is actually present

## What Was Not Adopted From Upstream

- No full ESM-only migration
- No Node 20 only engine jump
- No blind replacement of Neelegirl QR, ID, logging or device logic
- No forced adoption of every new upstream internal module

## Installation

```bash
npm install @neelegirl/baileys
```

## Quick Start

```js
const {
  default: makeWASocket,
  Browsers,
  DisconnectReason,
  fetchLatestBaileysVersion,
  useMultiFileAuthState
} = require('@neelegirl/baileys')
const { Boom } = require('@hapi/boom')

async function start() {
  const { state, saveCreds } = await useMultiFileAuthState('./auth_info')
  const { version } = await fetchLatestBaileysVersion()

  const sock = makeWASocket({
    version,
    auth: state,
    printQRInTerminal: true,
    browser: Browsers.ubuntu('Chrome')
  })

  sock.ev.on('creds.update', saveCreds)

  sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
    if (connection === 'close') {
      const shouldReconnect =
        (lastDisconnect?.error instanceof Boom
          ? lastDisconnect.error.output?.statusCode
          : undefined) !== DisconnectReason.loggedOut

      if (shouldReconnect) {
        start().catch(console.error)
      }
      return
    }

    if (connection === 'open') {
      console.log('WhatsApp Web connection opened')
    }
  })
}

start().catch(console.error)
```

## Pairing And QR Notes

- `printQRInTerminal: true` keeps the QR flow active
- `requestPairingCode(phoneNumber, customCode?)` is available on the socket
- This package keeps the existing Neelegirl QR and pairing behavior instead of replacing it with upstream packaging changes

## Addressing And Device Notes

The package keeps Neelegirl-specific message and device handling and now forwards the additional addressing fields more consistently:

- `key.remoteJid`
- `key.remoteJidAlt`
- `key.participant`
- `key.participantAlt`
- `key.addressingMode`

This is relevant for PN/LID mixed environments, Web-specific event handling and group/member tagging behavior.

## Exports Available In This Package

- Root entry: `require('@neelegirl/baileys')`
- Compatibility root subpath: `require('@neelegirl/baileys/lib')`
- WAProto subpath: `require('@neelegirl/baileys/WAProto')`

Primary runtime exports include:

- `makeWASocket`
- `proto`
- `Browsers`
- `fetchLatestBaileysVersion`
- `fetchLatestWaWebVersion`
- `useMultiFileAuthState`
- `useSingleFileAuthState`
- `useMongoFileAuthState`
- `makeInMemoryStore`
- `makeCacheManagerStore`

## Requirements

- Node.js `>=16.0.0`
- A WhatsApp account that is allowed to link a Web client

## Limits And Honesty Notes

- This package does not claim to be a 1:1 upstream 7.x layout
- This package does not bundle every new upstream internal module
- This README does not claim unsupported helpers such as `createSmartMessageQueue()`

## License

MIT