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

whatsapp-business-mock

v1.1.1

Published

A developer tool that mimics the WhatsApp Business API for local development and testing

Downloads

975

Readme

WhatsApp Business Mock (pt_BR)

Ferramenta open source para simular a WhatsApp Business Cloud API em desenvolvimento e testes locais, sem conta de produção na Meta.

Este repositório é 100% construído por IA, com curadoria e revisão humana.

Documentação em inglês (principal): README.md

O que inclui

  • Backend NestJS com rotas no estilo oficial (/v1 e /v25.0)
  • Painel admin em /admin
  • Chat estilo WhatsApp Web em /chat
  • SQLite (caminhos configuráveis)
  • Execução via npx ou Docker

Início rápido

npx whatsapp-business-mock

O tarball publicado é enxuto: dist/ compilado + @whatsapp-business-mock/shared embutido (bundleDependencies). As demais dependências de runtime são instaladas pelo npm/npx na máquina do usuário. O prepublishOnly não inclui dist/node_modules. Para artefato autocontido (Docker), use npm run package:dist completo. Em um clone do git, use npm run package:dist antes de publicar ou npm run dev para desenvolvimento.

Com npx, abra http://localhost:3000/admin e http://localhost:3000/chat na mesma porta do servidor.

Docker (guia completo): docker/README.md

Imagem publicada (após configurar o workflow no GitHub):

docker pull caiquesportela/whatsapp-business-mock:latest
docker run -d --name wbm -p 3000:3000 -v wbm-data:/data \
  -e DB_PATH=/data/whatsapp-business-mock.db \
  -e STORAGE_PATH=/data/uploads \
  caiquesportela/whatsapp-business-mock:latest

Build a partir do repositório:

docker compose -f docker/docker-compose.yml up --build
  • Admin: http://localhost:3000/admin
  • Chat: http://localhost:3000/chat
  • Swagger: http://localhost:3000/docs

Idioma da interface

en_US (padrão) e pt_BR no admin e no chat (seletor na interface; preferência em localStorage). A API e o Swagger permanecem em inglês.

Variáveis de ambiente

| Variável | Padrão | Descrição | |----------|--------|-----------| | PORT | 3000 | Porta HTTP | | DB_PATH | ./data/whatsapp-business-mock.db | SQLite | | STORAGE_PATH | ./data/uploads | Mídias | | BASE_URL | http://localhost:3000 | Links de mídia | | WHATSAPP_APP_SECRET ou APP_SECRET | vazio | Segredo do app: assina webhooks de saída e valida o endpoint de teste de entrada. Se vazio, a assinatura de saída é omitida e a verificação de entrada é ignorada (com aviso nos logs). |

Demais variáveis (SEED_*, LOG_LEVEL) — ver tabela completa no README.md.

Webhooks

  • Entrega com cabeçalho X-Hub-Signature-256 = HMAC-SHA256 do corpo JSON bruto (quando o segredo está definido).
  • Teste de POST com verificação: POST /local/webhook-config/receive/:phoneNumberId (corpo bruto + assinatura).

Chat

Rotas: /chat, /chat/:telefoneCliente, /chat/:telefoneCliente/:idConversa.

Com número WABA registrado, mensagens usam a API simulada. Sem WABA, use o modo peer (POST /local/conversations/peer-messages); abra o chat com o seu número na URL ou defina VITE_CLIENT_PHONE no build do front.

Desenvolvimento

npm install
npm run dev
npm test
npm run lint
npm run package:dist

Lançamento (GitHub Actions)

Fluxo sugerido: npm version patch && git push origin main --tags. Veja .github/workflows/release.yml e segredos NPM_TOKEN, DOCKERHUB_USERNAME, DOCKERHUB_TOKEN.

Licença

MIT — LICENSE