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

@wai-industries/whatsapp-wrappers

v0.1.1

Published

WhatsApp sender wrappers for Odin omni-channel and campaign-service

Readme

@wai-industries/whatsapp-wrappers

WhatsApp sender wrappers shared between omni-channel and campaign-service in the Odin backend. Contains only WhatsApp sender implementations. Does not contain customer-upsert logic, message-template approval tracking, or any domain utilities.

Published to npmjs.org under the @wai-industries scope (same pattern as @wai-industries/polylogger).

Contents

| Export | Description | |---|---| | EoceanWhatsAppSenderBase + subclasses | E-ocean HTTP sender per message type | | WSenderApiMessageSenderBase + subclasses | WSenderApi HTTP sender per message type | | EoceanMessageSenderFactory | Creates E-ocean senders by message type | | WSenderApiMessageSenderFactory | Creates WSenderApi senders by message type | | WhatsAppVendor | Vendor enum | | WhatsAppSenderMessageType | Sender-side message type enum | | Message payload interfaces | TextMessage, ImageMessage, … | | SendTemplateParams / SendTemplateResult | Campaign template-send interface | | TEMPLATE_PAUSED_ERROR_CODES | Meta/BSP error codes that mean template paused | | SessionKeyInvalidError | Thrown by WSenderApi sender on 401 + refresh |

Installation

npm install @wai-industries/whatsapp-wrappers

CI publish (Azure DevOps)

See devops/azure-devops-npm-publish.md.

Pipeline azure-pipelines.yml publishes to registry.npmjs.org on push to main using the NPM_TOKEN secret variable.

Local development with yalc

npm link has Windows symlink issues — use yalc for local iteration before a version is on npm.

npm install -g yalc
cd path\to\odin-whatsapp-wrappers
npm install
npm run build
yalc publish

cd path\to\odin-backend\omni-channel
yalc add @wai-industries/whatsapp-wrappers

# After changes:
cd path\to\odin-whatsapp-wrappers
npm run build && yalc push

Constructor injection design

Both sender base classes take (config, logger) — no module-level singletons.

import {
  EoceanMessageSenderFactory,
  EoceanSenderConfig,
  Logger,
  WhatsAppSenderMessageType,
} from '@wai-industries/whatsapp-wrappers';

const config: EoceanSenderConfig = { baseUrl: '...', apiKey: '...' };
const factory = new EoceanMessageSenderFactory(config, logger);
const sender = factory.getSender(WhatsAppSenderMessageType.TEXT);
await sender?.send({ to_number: '...', message_text: '...' });

WSenderApi — inject session key resolution (package never touches Redis):

import { WSenderApiMessageSenderFactory, WSenderApiSenderConfig } from '@wai-industries/whatsapp-wrappers';

const config: WSenderApiSenderConfig = {
  baseUrl: '...',
  resolveApiKey: () => sessionService.resolveSessionApiKey(),
  onUnauthorized: (sessionId) => sessionService.handle401Error(sessionId as string | number),
  sessionId: activeSessionId,
};
const factory = new WSenderApiMessageSenderFactory(config, logger);

Template send (Phase 2 / campaign-service)

const result = await sender.sendTemplate({
  to: '+923001234567',
  templateName: 'order_confirmation',
  language: 'en',
  components: [],
});

if (result.status === 'TEMPLATE_PAUSED') {
  // pause campaign and write CampaignAlert
}

Confirm E-ocean and WSenderApi template/HSM endpoint URLs and payload shapes with vendors before production campaign sends.

Deploy ordering (consumers)

  1. Publish this package to npm (pipeline or manual).
  2. Update consumer package.json to @wai-industries/whatsapp-wrappers@^x.y.z.
  3. Replace imports from any previous package name (e.g. @odin/whatsapp-wrappers).
  4. npm install, npm run build, npm run test.