npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@srlczinn/new-baileys

v7.0.0-rc.9-patch.1

Published

Fork da Baileys com compatibilidade para botoes, mensagens interativas e helpers LID/JID.

Readme

srlczinn/new-baileys

Fork do Baileys baseado na WhiskeySockets/Baileys, com ajustes de compatibilidade para fluxos que pararam de funcionar em versões recentes.

O que esta versão traz

  • compatibilidade extra para envio de botões e mensagens interativas
  • suporte legado para campos como buttons, templateButtons, sections, buttonText e interactiveButtons
  • helpers expostos no socket para conversão entre PN/JID e LID:
    • sock.getLIDForPN(pn)
    • sock.getLIDsForPNs(pns)
    • sock.getPNForLID(lid)
  • onWhatsApp() ajustado para consultar PN/JID e LID no mesmo fluxo e retornar:
    • jid
    • lid
    • exists

Instalação pelo GitHub

npm i github:srlczinn/new-baileys

Também pode usar a URL completa:

npm i https://github.com/srlczinn/new-baileys.git

Import

import makeWASocket from '@srlczinn/new-baileys'

Ou com imports nomeados:

import makeWASocket, {
  useMultiFileAuthState,
  makeCacheableSignalKeyStore,
  DisconnectReason,
  Browsers,
  proto
} from '@srlczinn/new-baileys'

Exemplo básico

import makeWASocket, {
  useMultiFileAuthState,
  makeCacheableSignalKeyStore,
  fetchLatestBaileysVersion
} from '@srlczinn/new-baileys'
import pino from 'pino'

const logger = pino({ level: 'silent' })
const { state } = await useMultiFileAuthState('./auth')
const { version } = await fetchLatestBaileysVersion()

const sock = makeWASocket({
  version,
  logger,
  auth: {
    creds: state.creds,
    keys: makeCacheableSignalKeyStore(state.keys, logger)
  }
})

Exemplo de botões legados

const buttons = [
  { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
  { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]

await sock.sendMessage(jid, {
  text: 'Oi, essa mensagem tem botões',
  footer: 'New Baileys',
  buttons,
  viewOnce: true
})

Exemplo de botões interativos/native flow

await sock.sendMessage(jid, {
  text: 'Escolha uma opção',
  footer: 'New Baileys',
  interactiveButtons: [
    {
      name: 'quick_reply',
      buttonParamsJson: JSON.stringify({
        display_text: 'Responder',
        id: 'responder_1'
      })
    }
  ],
  viewOnce: true
})

Exemplo de helpers LID/JID

const lid = await sock.getLIDForPN('[email protected]')
const pn = await sock.getPNForLID('1234567890@lid')
const mappings = await sock.getLIDsForPNs([
  '[email protected]',
  '[email protected]'
])

Exemplo do onWhatsApp com LID

const results = await sock.onWhatsApp(
  '[email protected]',
  '1234567890@lid'
)

console.log(results)
// [
//   { jid: '[email protected]', lid: '...', exists: true },
//   { jid: '1234567890@lid', lid: '...', exists: true }
// ]

Observações

  • esta biblioteca é um fork comunitário e não é o pacote oficial do projeto WhiskeySockets
  • o código-fonte vem da base do GitHub e as alterações ficam em src/, para o build gerar lib/ corretamente
  • recomenda-se travar a versão no seu projeto para evitar perder compatibilidade em atualizações futuras

Licença

Licença MIT

Copyright (c) 2026 Laercio Cerqueira/srlczinn

Licenciado sob a Licença MIT: É concedida permissão, gratuitamente, a qualquer pessoa que obtenha uma cópia deste software e arquivos de documentação associados (o "Software"), para lidar com o Software sem restrições, incluindo, sem limitação, os direitos de usar, copiar, modificar, fundir, publicar, distribuir, sublicenciar e/ou vender cópias do Software, e permitir que as pessoas a quem o Software é fornecido o façam, sujeitas às seguintes condições:

O aviso de direitos autorais acima e este aviso de permissão devem ser incluídos em todas as cópias ou partes substanciais do Software.

O SOFTWARE É FORNECIDO "NO ESTADO EM QUE SE ENCONTRA", SEM GARANTIA DE QUALQUER TIPO, EXPRESSA OU IMPLÍCITA, INCLUINDO, MAS NÃO SE LIMITANDO ÀS GARANTIAS DE COMERCIALIZAÇÃO, ADEQUAÇÃO A UM FIM ESPECÍFICO E NÃO VIOLAÇÃO. EM NENHUMA HIPÓTESE OS AUTORES OU DETENTORES DOS DIREITOS AUTORAIS SERÃO RESPONSÁVEIS POR QUAISQUER REIVINDICAÇÕES, DANOS OU OUTRAS RESPONSABILIDADES, SEJA EM AÇÃO CONTRATUAL, EXTRACONTRATUAL OU DE OUTRA NATUREZA, DECORRENTES DE, OU RELACIONADAS COM O SOFTWARE OU O USO OU OUTRAS NEGOCIAÇÕES COM O SOFTWARE.