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

@smartuy/builderbot-provider-waha

v1.2.8

Published

WAHA (WhatsApp HTTP API) provider for BuilderBot desarrollado por SmartUY

Readme

@smartuy/builderbot-provider-waha

Versión 1.2.7

Desarrollado por SmartUY

Este paquete fue creado y es mantenido por SmartUY, empresa líder en soluciones tecnológicas. Desarrollado por Juan Pablo (BigJuanPa) de SmartUY.

Nuevas características

  • Manejo mejorado de eventos de sesión y mensajes
  • Soporte para estados de conexión
  • Mejor manejo de errores y logging
  • Integración completa con BuilderBot
  • Validación de emails y entradas con fallBack()
  • Configuración segura con variables de entorno

Instalación

Para un nuevo proyecto:

npx @smartuy/builderbot-provider-waha init mi-bot

Para un proyecto existente:

npm install @smartuy/builderbot-provider-waha@latest

IMPORTANTE: Después de instalar, ejecuta npm install para instalar todas las dependencias necesarias.

Configuración

Crea un archivo .env con las siguientes variables:

WAHA_API_URL=https://tu-servidor-waha.com
WAHA_API_KEY=tu-api-key
WAHA_SESSION=default

Uso

Flujo simple

import { createBot, createFlow, MemoryDB, addKeyword } from '@builderbot/bot';
import { WahaProvider } from '@smartuy/builderbot-provider-waha';
import express from 'express';
import dotenv from 'dotenv';

// Cargar variables de entorno
dotenv.config();

// Crear app Express para webhook
const app = express();
app.use(express.json());

// Definir un flujo simple
const bienvenidaFlow = addKeyword(['hola', 'buenas', 'saludos'])
  .addAnswer('¡Hola! Bienvenido al bot de SmartUY. ¿En qué podemos ayudarte hoy?');

// Inicializar el bot
const main = async () => {
  // Configurar el provider
  const wahaConfig = {
    url: process.env.WAHA_API_URL,
    token: process.env.WAHA_API_KEY,
    session: process.env.WAHA_SESSION
  };
  
  // Crear provider
  const adapterProvider = new WahaProvider(wahaConfig);
  
  // Inicializar webhook
  adapterProvider.initWebhook(app);
  
  // Crear flow
  const adapterFlow = createFlow([bienvenidaFlow]);
  
  // Crear base de datos
  const adapterDB = new MemoryDB();
  
  // Crear bot
  const bot = await createBot({
    flow: adapterFlow,
    provider: adapterProvider,
    database: adapterDB,
  });
  
  // Iniciar servidor
  app.listen(3000, () => {
    console.log('¡Servidor webhook de SmartUY ejecutándose en puerto 3000!');
  });
};

main();

Verificar estado de conexión

El provider verifica automáticamente el estado de la sesión de WhatsApp y la inicia si es necesario.

Eventos

El provider maneja los siguientes eventos:

1. Estado de Sesión

  • Verifica si la sesión está activa
  • Inicia la sesión automáticamente si está detenida
  • Maneja errores de conexión

2. Mensajes

  • Recibe mensajes a través del webhook
  • Procesa y formatea los mensajes para BuilderBot
  • Emite los mensajes al flujo del bot

Características

  • Webhook integrado: Recibe mensajes de WhatsApp automáticamente
  • Manejo de estado: Almacena información del usuario entre mensajes
  • Validación de entradas: Utiliza fallBack() para validar emails y otras entradas
  • Flujos de conversación: Implementa flujos de bienvenida, registro y ayuda
  • Seguridad: Usa variables de entorno para datos sensibles
  • CLI: Herramienta para crear proyectos rápidamente

Migración

Si vienes de una versión anterior, asegúrate de:

  1. Actualizar a la última versión con npm install @smartuy/builderbot-provider-waha@latest
  2. Ejecutar npm install para actualizar todas las dependencias
  3. Usar las nuevas funciones de validación con fallBack()
  4. Configurar correctamente las variables de entorno

Recursos

Soporte

Para soporte, contacta a SmartUY o abre un issue en el repositorio. Desarrollado con ❤️ por Juan Pablo (BigJuanPa) de SmartUY.

Licencia

MIT