Skip to main content

Installation

Requirements

  • Node.js >= 18

Install

npm install @whatsmeow-node/whatsmeow-node

The correct Go binary for your platform is installed automatically via optionalDependencies.

Supported Platforms

OSx64arm64musl (Alpine)
macOS-
Linuxx64 only
Windows-

Store Options

The store option accepts:

  • SQLite: session.db or ./data/wa.db — Creates a local database file. Plain paths are auto-prefixed with file:.
  • PostgreSQL: postgres://user:pass@host/db — For multi-instance deployments or serverless.

SQLite is configured automatically with WAL mode, foreign keys, and busy timeout.

Usage with Next.js

Next.js bundles server code by default and will try to parse the Go binary as JavaScript. Add all @whatsmeow-node packages to serverExternalPackages:

const nextConfig: NextConfig = {
serverExternalPackages: [
"@whatsmeow-node/whatsmeow-node",
"@whatsmeow-node/darwin-arm64",
"@whatsmeow-node/darwin-x64",
"@whatsmeow-node/linux-arm64",
"@whatsmeow-node/linux-x64",
"@whatsmeow-node/linux-x64-musl",
"@whatsmeow-node/win32-arm64",
"@whatsmeow-node/win32-x64",
],
};

Only your deployment platform's package will be installed (npm resolves by os/cpu), but listing all of them ensures it works in any environment.