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

@mataram/wa

v0.11.0

Published

A WebSockets library for interacting with WhatsApp Web

Readme

@mataram/wa

TypeScript library for the WhatsApp Web API. Direct WebSocket connection — no browser, no Selenium.

npm install @mataram/wa

Cara Termudah — create-mataram-bot

Bikin project bot langsung jadi dengan satu perintah:

npx create-mataram-bot my-bot 6281234567890
cd my-bot
npm install
npm start

Bot langsung bisa pairing code + auto-reconnect + 8 perintah interaktif.


Quick Start

import makeWASocket, { useMultiFileAuthState, DisconnectReason, Browsers } from '@mataram/wa'

const { state, saveCreds } = await useMultiFileAuthState('auth_info')

const sock = makeWASocket({
  auth: state,
  browser: Browsers.macOS('Chrome'),
})

sock.ev.on('creds.update', saveCreds)

sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
  if (connection === 'open') console.log('Connected:', sock.user?.id)
  if (connection === 'close') {
    const code = lastDisconnect?.error?.output?.statusCode
    if (code !== DisconnectReason.loggedOut) {
      setTimeout(() => process.exit(), 3000)
    }
  }
})

if (!state.creds.registered) {
  const code = await sock.requestPairingCode('6281234567890')
  console.log('Pairing code:', code)
}

Documentation

Full interactive documentation is available in docs/index.html — bilingual (🇮🇩 Indonesia + 🇬🇧 English), mobile-first, with code examples for every feature.

Features

| Category | Methods | |---|---| | Connection | makeWASocket, requestPairingCode, logout, end, waitForConnectionUpdate | | Send Messages | sendMessage — text, image, video, audio, document, sticker, poll, event, album, location, contacts, reactions, edit, delete, pin, forward, view once, disappearing | | Interactive | Quick reply buttons, template buttons (URL/call), list menus, native flow, rich text | | Groups | groupCreate, groupMetadata, groupParticipantsUpdate, groupUpdateSubject, groupUpdateDescription, groupSettingUpdate, groupToggleEphemeral, groupInviteCode, groupRevokeInvite, groupAcceptInvite, groupGetInviteInfo, groupLeave, groupJoinApprovalMode, groupMemberAddMode, groupFetchAllParticipating, groupRequestParticipantsList, groupRequestParticipantsUpdate | | Communities | communityCreate, communityCreateGroup, communityLinkGroup, communityUnlinkGroup, communityFetchLinkedGroups, communityMetadata, communityParticipantsUpdate, communityUpdateSubject, communityUpdateDescription, communityInviteCode, communityAcceptInvite, communitySettingUpdate, communityToggleEphemeral, communityLeave | | Newsletter | newsletterCreate, newsletterFollow, newsletterUnfollow, newsletterMetadata, newsletterUpdateName, newsletterUpdateDescription, newsletterUpdatePicture, newsletterRemovePicture, newsletterReactMessage, newsletterMute, newsletterUnmute, newsletterSubscribers, newsletterFetchMessages, subscribeNewsletterUpdates, newsletterAdminCount, newsletterChangeOwner, newsletterDemote, newsletterDelete | | Events | messages.upsert, messages.update, messages.delete, messages.reaction, messages.media-update, message-receipt.update, connection.update, creds.update, chats.upsert, chats.update, chats.delete, contacts.upsert, contacts.update, groups.upsert, groups.update, group-participants.update, presence.update, call, blocklist.update, blocklist.set, messaging-history.set, messaging-history.status, newsletter.reaction, newsletter.view, newsletter-settings.update, newsletter-participants.update, labels.edit, labels.association, settings.update, lid-mapping.update, message-capping.update | | Chat | readMessages, sendReceipt, chatModify (archive, mute, pin, delete, clear, markRead), star, sendPresenceUpdate, presenceSubscribe, fetchStatus, fetchDisappearingDuration, addOrEditContact, removeContact | | Profile | updateProfileName, updateProfileStatus, updateProfilePicture, removeProfilePicture, profilePictureUrl, fetchBlocklist, updateBlockStatus | | Privacy | updateLastSeenPrivacy, updateOnlinePrivacy, updateProfilePicturePrivacy, updateStatusPrivacy, updateReadReceiptsPrivacy, updateMessagesPrivacy, updateCallPrivacy, updateGroupsAddPrivacy, updateDefaultDisappearingMode, updateDisableLinkPreviewsPrivacy | | Business | getBusinessProfile, updateBussinesProfile, updateCoverPhoto, removeCoverPhoto, getCatalog, getCollections, productCreate, productUpdate, productDelete, getOrderDetails | | Labels | addLabel, addChatLabel, removeChatLabel, addMessageLabel, removeMessageLabel, addOrEditQuickReply, removeQuickReply, updateMemberLabel | | Calls | createCallLink (audio/video), rejectCall | | Media | downloadContentFromMessage, downloadMediaMessage, updateMediaMessage, waUploadToServer | | Signal | assertSessions, uploadPreKeys, rotateSignedPreKey, digestKeyBundle, sendPeerDataOperationMessage | | USync | onWhatsApp, executeUSyncQuery | | Account | fetchAccountReachoutTimelock, fetchNewChatMessageCap, fetchPrivacySettings | | Utilities | fetchLatestVersion, getContentType, getDevice, BufferJSON, makeCacheableSignalKeyStore, jidDecode, jidNormalizedUser, areJidsSameUser |

Config

const sock = makeWASocket({
  auth,                                   // Required
  browser: Browsers.macOS('Chrome'),       // Browser identity
  version: [2, 3000, 1035194821],          // WA Web version
  connectTimeoutMs: 20000,                 // Connection timeout
  keepAliveIntervalMs: 30000,              // Ping interval
  markOnlineOnConnect: true,               // Show online
  syncFullHistory: true,                   // Sync history
  fireInitQueries: true,                   // Auto-init queries
  emitOwnEvents: true,                     // Own action events
  logger: pino({ level: 'silent' }),       // Logger
  agent: socksProxyAgent,                  // WS proxy
  fetchAgent: socksAgent,                  // HTTP proxy
  getMessage: async (key) => store.get(key),
  cachedGroupMetadata: async (jid) => cache.get(jid),
})

Error Codes

| Code | Constant | Meaning | |---|---|---| | 401 | DisconnectReason.loggedOut | Session expired — re-auth required | | 403 | DisconnectReason.forbidden | Account restricted | | 408 | DisconnectReason.timedOut | Request timed out | | 428 | DisconnectReason.connectionClosed | Connection closed | | 440 | DisconnectReason.connectionReplaced | Logged in elsewhere | | 500 | DisconnectReason.badSession | Corrupted session | | 515 | DisconnectReason.restartRequired | Normal restart after pairing | | 411 | DisconnectReason.multideviceMismatch | Multi-device beta not joined |

License

MIT © 2025 Ibra Decode

Not affiliated with WhatsApp or Meta.