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

@redonvn/messaging-viber-bot

v1.0.0

Published

Official Viber Bot and Public Account REST API SDK for RedAI

Readme

@redonvn/messaging-viber-bot — Official Viber REST Bot API SDK for RedAI Omnichat

SDK TypeScript cho Viber Bot/Public Account REST API chính thức (https://chatapi.viber.com/pa), tích hợp vào hệ thống RedAI Omnichat và Omnichannel Messaging Hub. Đây là SDK server-side dùng bot token và webhook; không phải SDK điều khiển Viber Desktop hay đăng nhập tài khoản cá nhân.


Tính năng nổi bật

  1. Bao phủ 100% các loại tin nhắn Viber (client.messages — 13 methods):
    • sendText, sendPicture, sendVideo, sendFile, sendContact, sendLocation, sendUrl, sendSticker, sendRichMediaCarousel (lưới Carousel 6x7), sendRaw.
    • broadcast: Gửi tin nhắn hàng loạt tới tối đa 300 người dùng / lượt (POST /pa/broadcast_message), bóc tách chi tiết failed_list.
    • postToPublicChannel: Đăng bài lên Viber Channel / Public Account (POST /pa/post).
    • buildWelcomeMessageResponse: Phản hồi đồng bộ (Synchronous Welcome Message) ngay trong HTTP 200 OK của sự kiện conversation_started.
    • Hỗ trợ đính kèm Interactive Keyboard (reply, open-url, location-picker, share-phone, none), tracking_data (4.000 bytes) và ghi đè sender.name/sender.avatar theo từng nhân viên CSKH.
  2. Quản lý Hồ sơ Người dùng & Trạng thái Online (client.users):
    • getUserDetails(userId) / getProfile(userId) (POST /pa/get_user_details)
    • getOnlineStatus(userIds) / getSingleUserOnlineStatus(userId) (POST /pa/get_online — tối đa 100 IDs / lượt, trả về mã 0..4 và last_online).
  3. Quản lý Tài khoản Bot & Channel (client.account):
    • getAccountInfo() (POST /pa/get_account_info — lấy id, uri, subscribers_count, members, event_types).
  4. Quản lý Đăng ký Webhook (client.subscriptions):
    • setWebhook(url, options) & removeWebhook() (POST /pa/set_webhook).
  5. Xác thực Bảo mật HMAC-SHA256 & Giải mã 8 Sự kiện Webhook (client.webhook):
    • Kiểm tra chữ ký X-Viber-Content-Signature (hoặc ?sig=...) chống giả mạo bằng CryptoUtils.timingSafeEqual.
    • Bảo toàn chính xác tuyệt đối chuỗi số nguyên 64-bit message_token (> Number.MAX_SAFE_INTEGER).
    • Giải mã chi tiết 8 sự kiện: webhook, message, conversation_started (kèm QR context), subscribed, unsubscribed, delivered, seen, failed.

Cấu trúc Tài liệu SDK

Phạm vi API

Định danh nền tảng của SDK là VIBER_BOT (client.platformName và kết quả webhook chuẩn hóa). Package yêu cầu Node.js 18 trở lên; kiểu Buffer được import từ node:buffer và gói phân phối kèm dependency @types/node.

SDK bao phủ các endpoint Bot API được tài liệu hóa công khai gồm gửi tin/broadcast/đăng Channel, thông tin bot và user, trạng thái online, webhook, Chat Extensions và payment (nếu Viber/PSP bật cho bot). Viber không công khai API Bot để đăng nhập tài khoản cá nhân, đọc lịch sử inbox, liệt kê mọi bạn bè/người đăng ký, sửa/xóa/reaction tin nhắn hoặc kết nối socket cá nhân. Xem API_COVERAGE.md để biết mapping endpoint sang service và các giới hạn.

Để quản lý tiến trình Viber Desktop trên máy tính, dùng package riêng @redonvn/messaging-viber-desktop; hai package có mô hình kết nối khác nhau.