@mulmobridge/viber
v0.1.1
Published
Viber bridge for MulmoBridge — Public Account chatbot via webhook + REST
Downloads
28
Readme
@mulmobridge/viber
Experimental — please test and report issues.
Viber Public Account chatbot bridge for MulmoClaude. Receives user messages via HTTPS webhook, replies via the Viber Bot REST API. Popular in Eastern Europe, Southeast Asia, and parts of the Middle East.
Public URL required (Viber only supports webhook delivery).
Setup
1. Create a Public Account (Bot)
- Open Viber app → More → Public Accounts → Create Account.
- Complete the onboarding; pick a category.
- On the admin panel (partners.viber.com) → Your Account → Edit Info → Chatbot / Subscribe Bot → copy the Authentication Token.
2. Expose the bridge
ngrok http 3012
# → https://abcd.ngrok-free.app3. Set the webhook
Once you have the public URL, register it with Viber. Either via the admin panel, or via a one-off HTTP call:
curl -X POST https://chatapi.viber.com/pa/set_webhook \
-H "X-Viber-Auth-Token: <VIBER_AUTH_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"url":"https://abcd.ngrok-free.app/viber","event_types":["message"]}'4. Run the bridge
VIBER_AUTH_TOKEN=... \
npx @mulmobridge/viberSend a message to your Public Account from the Viber app — you'll get a reply.
Environment variables
| Variable | Required | Default | Description |
|------------------------|----------|-----------------|-------------|
| VIBER_AUTH_TOKEN | yes | — | Public Account auth token from the admin panel |
| VIBER_SENDER_NAME | no | MulmoClaude | Display name used on outbound messages |
| VIBER_WEBHOOK_PORT | no | 3012 | HTTP port |
| VIBER_ALLOWED_USERS | no | (all) | CSV of Viber user IDs allowed (empty = everyone who messages the bot) |
| MULMOCLAUDE_AUTH_TOKEN | no | auto | MulmoClaude bearer token override |
| MULMOCLAUDE_API_URL | no | http://localhost:3001 | MulmoClaude server URL |
How it works
- Viber POSTs event JSON to
/viberwith anX-Viber-Content-Signatureheader (HMAC-SHA256 of the raw body keyed on the auth token). - The bridge verifies the signature in constant time and ACKs
200immediately so Viber doesn't retry. - For
event:"message"withmessage.type === "text", the bridge runs the allowlist, then forwardsmessage.textto MulmoClaude keyed bysender.id. - Replies go out via
POST /pa/send_messagewith the auth token in theX-Viber-Auth-Tokenheader. Chunked at 7 000 chars.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Webhook registration returns {"status":10,"status_message":"No URL parameter supplied."} | Typo in set_webhook call | Re-check JSON body |
| Invalid signature on all events | Rotation mismatch between VIBER_AUTH_TOKEN and the token used to register the webhook | Re-register the webhook using the current token |
| send non-zero status: {"status":6,…} | Receiver hasn't messaged your bot first | Viber requires the user to start the conversation before you can push to them |
Security notes
- The auth token is both the bot's identity and the webhook signing key — rotate it via the admin panel if it leaks.
VIBER_ALLOWED_USERSis recommended. Without it, anyone who finds your Public Account can chat with your agent.- Viber's chat history is controlled by the Viber app — the bridge itself keeps no local message log.
Ecosystem
Part of the @mulmobridge/* package family.
Shared libraries:
@mulmobridge/client— socket.io client library used by every bridge below@mulmobridge/protocol— wire types and constants@mulmobridge/chat-service— server-side relay + session store@mulmobridge/relay— Cloudflare Workers webhook proxy@mulmobridge/mock-server— mock server for local bridge development
Bridges (one npm package per platform):
@mulmobridge/bluesky— Bluesky DMs over atproto@mulmobridge/chatwork— Chatwork (Japanese business chat)@mulmobridge/cli— interactive terminal bridge@mulmobridge/discord— Discord bot via Gateway@mulmobridge/email— IMAP poll + SMTP reply, threading preserved@mulmobridge/google-chat— Google Chat via MulmoBridge relay@mulmobridge/irc— IRC (Libera, Freenode, custom)@mulmobridge/line— LINE Messaging API via MulmoBridge relay@mulmobridge/line-works— LINE Works (enterprise LINE)@mulmobridge/mastodon— Mastodon DMs + mentions@mulmobridge/matrix— Matrix / Element@mulmobridge/mattermost— Mattermost@mulmobridge/messenger— Facebook Messenger via MulmoBridge relay@mulmobridge/nostr— Nostr NIP-04 encrypted DMs@mulmobridge/rocketchat— Rocket.Chat@mulmobridge/signal— Signal via signal-cli-rest-api@mulmobridge/slack— Slack Socket Mode@mulmobridge/teams— Microsoft Teams via Bot Framework@mulmobridge/telegram— Telegram bot@mulmobridge/twilio-sms— SMS via Twilio Programmable Messaging@mulmobridge/viber— Viber Public Account bots ← this package@mulmobridge/webhook— generic HTTP webhook bridge@mulmobridge/whatsapp— WhatsApp Cloud API via MulmoBridge relay@mulmobridge/xmpp— XMPP / Jabber@mulmobridge/zulip— Zulip
