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

veevotech-whatsapp

v1.0.0

Published

Standalone WhatsApp Business API client wrapper for Veevo Tech CPaaS platform using native fetch

Readme

veevotech-whatsapp

A lightweight, zero-dependency Node.js client wrapper for Veevo Tech's WhatsApp Business API framework. Engineered entirely on the native HTTP fetch API for compatibility with modern environments like Node.js (18+), Express, and Next.js.

Core Features

  • Zero Dependencies: Built natively to limit bundle overhead.
  • Flexible Message Mapping: Supports standard text, template variables, files, and rich interaction schemas.
  • Automated Form Boundaries: Native multi-part handling handles media uploads cleanly.
  • Account Analytics: Run live usage metrics and real-time wallet tracing directly from the wrapper.

Installation

npm install veevotech-whatsapp

Initialization

Add your custom security authentication hash variable to your project profile (.env):

VEEVOTECH_WHATSAPP_HASH="your_unique_whatsapp_hash_here"

Initialize the interface wrapper inside your service pipeline:

import { VeevoTechWhatsApp } from 'veevotech-whatsapp';

const waClient = new VeevoTechWhatsApp({
  hash: process.env.VEEVOTECH_WHATSAPP_HASH
});

Content Message Layouts & Return Responses

1. Send Text Messages

const result = await waClient.sendMessage({
  to: '923001234567',
  type: 'text',
  text: { body: 'Hello, this is a clean text message payload.' }
});

Success Response JSON Structure

{
  "status": "SUCCESS",
  "data": {
    "STATUS": "SUCCESSFUL",
    "MESSAGE_ID": "669536ec23850d201ef0aeab",
    "ERROR_FILTER": "",
    "ERROR_CODE": "",
    "ERROR_DESCRIPTION": ""
  }
}

2. Send Business Templates

const result = await waClient.sendMessage({
  to: '923001234567',
  type: 'template',
  template_id: 42,
  header_variables: ['John'],
  body_variables: ['var1', 'var2'],
  media_url: [],
  priority: 1
});

3. Media Uploads & Message Piping

import fs from 'fs';

const rawBuffer = fs.readFileSync('./invoice.pdf');
const uploadResult = await waClient.uploadMedia(rawBuffer, 'invoice.pdf');

if (uploadResult.status === 'SUCCESS') {
  const fileId = uploadResult.data.FILE_ID;

  await waClient.sendMessage({
    to: '923001234567',
    type: 'document',
    document: {
      link: fileId,
      filename: 'invoice.pdf',
      caption: 'Your monthly statement overview'
    }
  });
}

Media Upload Success Response

{
  "status": "SUCCESS",
  "data": {
    "STATUS": "SUCCESSFUL",
    "FILE_ID": "933559029115799",
    "FILE_URL": "",
    "ERROR_CODE": "",
    "ERROR_DESCRIPTION": ""
  }
}

Other Media Types

  • Image: type: "image", image: { link: fileId, caption: "Hi!" }
  • Audio: type: "audio", audio: { link: fileId }
  • Video: type: "video", video: { link: fileId, caption: "Watch this" }

Interactive Components

Location Request

await waClient.sendMessage({
  to: '923001234567',
  type: 'interactive',
  interactive: {
    type: 'location_request_message',
    body: { text: 'Please share your dynamic shipping dropoff address.' },
    action: { name: 'send_location' }
  }
});

Location Message

await waClient.sendMessage({
  to: '923001234567',
  type: 'location',
  location: {
    latitude: '31.5204',
    longitude: '74.3587',
    name: 'Veevo Tech HQ',
    address: 'Lahore, Pakistan'
  }
});

General Button Messages

await waClient.sendMessage({
  to: '923001234567',
  type: 'interactive',
  interactive: {
    type: 'button',
    header: { type: 'text', text: 'Confirm Actions' },
    body: { text: 'Would you like to authorize this processing order call?' },
    footer: { text: 'Select option below' },
    action: {
      buttons: [
        { type: 'reply', reply: { id: 'btn_yes', title: 'Yes, Proceed' } },
        { type: 'reply', reply: { id: 'btn_no', title: 'Cancel Order' } }
      ]
    }
  }
});

Call to Action (CTA) URL

await waClient.sendMessage({
  to: '923001234567',
  type: 'interactive',
  interactive: {
    type: 'cta_url',
    header: { type: 'text', text: 'Tracking Framework Portal' },
    body: { text: 'Your delivery truck is in transit. View progress updates via link.' },
    footer: { text: 'Ecom Nest Logistics' },
    action: {
      name: 'cta_url',
      parameters: {
        display_text: 'Open Maps Route',
        url: 'https://example.com/track/route'
      }
    }
  }
});

Metric Analytics & Wallet Reporting

Get Yearly Analytics

const report = await waClient.getYearlyAnalytics();

Get Credit History

const history = await waClient.getCreditHistory();

Error Pipeline Interception

Always map backend exception checks to error.filter.

Expected Error Sample

{
  "status": "ERROR",
  "error": {
    "filter": "NO_OPEN_CONV",
    "description": "Failed to send your message, no user-initiated conversation found with this contact.",
    "code": "VTWE-144773755"
  }
}

Author

Nouman Qamar
Digital Marketing Professional & Full-Stack Engineer.