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

@msgly/viber

v1.4.0

Published

Viber Business Messages adapter for Msgly — rich media, keyboards, signed webhooks

Readme

@msgly/viber

📖 Docs & channel reference: https://ayushjain070401.github.io/msgly/

Viber Business Messages adapter for Msgly — rich media, keyboards, and HMAC-signed webhooks.

npm install @msgly/core @msgly/viber
import { createHub } from '@msgly/core';
import { createViberAdapter } from '@msgly/viber';

const viber = createViberAdapter({
  authToken: process.env.VIBER_AUTH_TOKEN!,
  senderName: 'Acme Support',
  senderAvatar: 'https://cdn.acme.com/logo.png',
});

const hub = createHub().register(viber);

// One-time, at deploy: the endpoint must already be live, because Viber
// immediately POSTs a verification event to it.
await viber.setWebhook('https://example.com/webhook/viber');

Users must subscribe first

Viber has no way to initiate a conversation with an arbitrary user — you can only message people who have subscribed to your public account. Sending to anyone else fails with receiverNotSubscribed.

HTTP 200 does not mean sent

Viber answers 200 for failures too; the JSON status field is the real result and only 0 means success. This adapter checks it, so a failed send returns a failed receipt rather than a false success.

Keyboards

Interactive buttons render as a Viber keyboard. 2D button layouts are flattened (Viber lays out its own grid) and capped at 24, its maximum:

content: {
  type: 'interactive',
  text: 'Pick one',
  buttons: [{ id: 'yes', label: 'Yes' }, { id: 'no', label: 'No' }],
}

Media

Viber fetches media itself, so pass a public URL — there's no upload endpoint, and a platform-id reference fails fast with a clear message.

Supported: images (picture), video, and files. Audio has no send type in the messages API, so capabilities.media.audio is false.

Broadcast

Send one message to many subscribers in a single call — max 300 receivers:

const receipt = await viber.broadcast(subscriberIds, {
  type: 'text',
  text: 'Sale starts now',
});

Viber reports per-recipient outcomes rather than failing the whole call, so a partial failure is the normal case — some subscribers will have blocked the account. Those ids come back ready to retire:

for (const { id } of receipt.metadata?.failed ?? []) {
  await suppression.suppress('viber', id, { source: 'bounce' });
}

The receipt is sent when any recipient succeeded, and failed only when every one did. Split larger audiences into chunks of 300 — going over returns a permanent viber_broadcast_limit rather than a truncated send.

License

MIT