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-mdf

v1.0.9

Published

SDK for interfacing with WhatsApp Business Platform in Typescript or Node.js using the Cloud API, hosted by Meta.

Downloads

22

Readme

WhatsApp Business Platform Node.js SDK (MDF Fork)


Status

⚠️ IMPORTANTE: Este es un fork personal del proyecto original

Este paquete (whatsapp-mdf) es un fork personal del WhatsApp Node.js SDK oficial que fue archivado por Meta.

Proyecto Original:

Este Fork (whatsapp-mdf):

Para más información sobre por qué se archivó el proyecto original, visita este issue de GitHub.


Bienvenido al SDK para la Plataforma de WhatsApp Business. Este SDK, escrito para el framework Node.js, simplifica el acceso a la Cloud API. El código fuente está escrito en Typescript y viene con archivos de declaración de TypeScript para verificar el tipado y ofrecer autocompletado en tu IDE.

lint, prettify, spellcheck, test, and build generate docs

Getting started

Consulta la documentación de inicio rápido para aprender a usar el SDK.

Installation

Instala este SDK usando yarn:

yarn add whatsapp-mdf

O npm:

npm install whatsapp-mdf

Configuración y Uso

La configuración del SDK se realiza pasando un objeto de configuración al constructor de la clase WhatsApp. Esto te permite inicializar y configurar el cliente de forma programática.

Aquí tienes un ejemplo de cómo instanciar el SDK:

import WhatsApp from 'whatsapp-mdf';

const wa = new WhatsApp({
    CLOUD_API_ACCESS_TOKEN:  'TU_TOKEN_DE_ACCESO',
    WA_PHONE_NUMBER_ID:'1234567890',
    WA_BUSINESS_ACCOUNT_ID: '1234567890',
    WEBHOOK_VERIFICATION_TOKEN: 'tu_token_de_verificacion',
    CLOUD_API_VERSION: 'v17.0',
    DEBUG: true
});

Puedes pasar cualquiera de las siguientes claves en el objeto de configuración. Aunque el uso de variables de entorno (como process.env) es una práctica común, puedes pasar los valores directamente.

  • CLOUD_API_ACCESS_TOKEN: (Requerido) Tu token de acceso de la Cloud API.
  • WA_PHONE_NUMBER_ID: (Requerido) El ID de tu número de teléfono de WhatsApp.
  • WA_BUSINESS_ACCOUNT_ID: (Requerido) El ID de tu cuenta de empresa de WhatsApp.
  • M4D_APP_ID: El ID de tu aplicación de Meta for Developers.
  • M4D_APP_SECRET: El secreto de tu aplicación de Meta for Developers.
  • CLOUD_API_VERSION: La versión de la Cloud API a utilizar (p. ej. 'v16.0').
  • WEBHOOK_ENDPOINT: El endpoint para tu webhook de entrada.
  • WEBHOOK_VERIFICATION_TOKEN: El token para verificar las cargas útiles del webhook.
  • LISTENER_PORT: El puerto para el listener de la aplicación (por defecto 3000).
  • DEBUG: Activa el logging de depuración (p. ej. true).
  • MAX_RETRIES_AFTER_WAIT: Número de reintentos de petición (por defecto 30).
  • REQUEST_TIMEOUT: Timeout para las peticiones en milisegundos (por defecto 20000).
  • WA_BASE_URL: La URL base para las peticiones del SDK (por defecto graph.facebook.com).

Diferencias con el proyecto original

Este fork mantiene la funcionalidad original pero añade:

  • Mantenimiento activo: Correcciones de bugs y actualizaciones de dependencias.
  • Compatibilidad: Asegura el funcionamiento con versiones recientes de Node.js.
  • Mejoras de la comunidad: Abierto a contribuciones para mejorar el SDK.
  • Configuración Programática y Centralizada:
    • Configuración Flexible: El constructor de la clase WhatsApp ahora acepta un objeto config opcional. Esto te permite configurar el SDK mediante programación (p. ej. new WhatsApp({ CLOUD_API_ACCESS_TOKEN: '...' })) en lugar de depender únicamente de variables de entorno.
    • Inicialización Centralizada: La configuración proporcionada se utiliza para instanciar y centralizar todos los componentes necesarios del SDK en un solo lugar, incluyendo:
      • Requester: El cliente HTTP para todas las llamadas a la API.
      • MessagesAPI: El módulo para enviar mensajes.
      • PhoneNumbersAPI: El módulo para gestionar números.
      • TwoStepVerificationAPI: Para la verificación en dos pasos.
      • WebhooksAPI: Para la gestión de webhooks.

Code of Conduct

Meta has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contribute

See the CONTRIBUTING file for our development process, how to propose bugfixes and improvements, and how to build and test your changes to the WhatsApp Business Platform Node.js SDK.

License

The WhatsApp Business Platform Node.js SDK for the Cloud API is Meta Platforms licensed, as found in the LICENSE file.

Créditos

Este proyecto es un fork del WhatsApp Node.js SDK oficial desarrollado por Meta Platforms. Todos los derechos del código original pertenecen a Meta Platforms, Inc. y sus afiliados.