{"_id":"@atharvh01/wakit","_rev":"15-26b76eb798cf0cf6f203fbeaef88609f","name":"@atharvh01/wakit","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.0":{"name":"@atharvh01/wakit","version":"2.0.0","keywords":["whatsapp","automation"],"author":{"name":"WAKit"},"license":"MIT","_id":"@atharvh01/wakit@2.0.0","maintainers":[{"name":"atharvh01","email":"atharvhatwar02@gmail.com"}],"homepage":"https://github.com/atharv01h/WAKit/","bugs":{"url":"https://github.com/atharv01h/WAKit/issues"},"dist":{"shasum":"25d428752227b4525ebb75f03c89ae14ffd32af7","tarball":"https://registry.npmjs.org/@atharvh01/wakit/-/wakit-2.0.0.tgz","fileCount":561,"integrity":"sha512-DiH96N+ai2WrDKIleRuJGQpkUk0XIvj1SgnU7XLQigRwUT7lJmF526xqy7esEqnIpvuikfsORTPCo4pCKErn4Q==","signatures":[{"sig":"MEYCIQDErnYJ5CQX808yLJ0rP0aOKakShQQ1WfHRIM02bWP2XwIhAKhIQImD+njmTa497QdGfmObb1JuggbM43b79tsE7XEQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9274723},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"015805e4a9c7192060182f093920db2cfcc501ee","scripts":{"lint":"tsc && eslint src --ext .js,.ts","test":"node --experimental-vm-modules ./node_modules/.bin/jest --testMatch '**/*.test.ts'","build":"tsc -P tsconfig.build.json && tsc-esm-fix --tsconfig=tsconfig.build.json --ext=.js","format":"prettier --write \"src/**/*.{ts,js,json,md}\"","example":"tsx ./Example/example.ts","prepack":"npm run build","prepare":"npm run build","release":"release-it","lint:fix":"npm run format && npm run lint -- --fix","test:e2e":"NODE_TLS_REJECT_UNAUTHORIZED=0 node --experimental-vm-modules ./node_modules/.bin/jest --runInBand --forceExit --testMatch '**/*.test-e2e.ts'","build:all":"npm run build && npm run build:docs","build:docs":"typedoc","preinstall":"node ./engine-requirements.js","gen:protobuf":"sh WAProto/GenerateStatics.sh","changelog:last":"conventional-changelog -p angular -r 2","update:version":"tsx ./scripts/update-version.ts","changelog:update":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","changelog:preview":"conventional-changelog -p angular -u"},"_npmUser":{"name":"atharvh01","email":"atharvhatwar02@gmail.com"},"repository":{"url":"git+ssh://git@github.com/atharv01h/WAKit.git"},"_npmVersion":"11.19.0","description":"A WebSockets library for interacting with WhatsApp Web","directories":{},"resolutions":{"tar":"^7.5.11","tmp":"^0.2.5","socks":"^2.8.8","flatted":"^3.4.2","basic-ftp":"^5.2.4","handlebars":"^4.7.9","ip-address":"^10.1.1","underscore":"^1.13.8","markdown-it":"^14.1.1","ajv@npm:^6.12.4":"^6.14.0","yaml@npm:^2.6.1":"^2.8.4","glob@npm:^10.2.2":"^10.5.0","glob@npm:^10.5.0":"^10.5.0","glob@npm:^10.3.10":"^10.5.0","js-yaml@npm:^4.1.0":"^4.1.1","js-yaml@npm:^3.13.1":"^3.14.2","minimatch@npm:^3.0.4":"^3.1.5","minimatch@npm:^3.1.2":"^3.1.5","minimatch@npm:^5.0.1":"^5.1.8","minimatch@npm:^9.0.4":"^9.0.9","minimatch@npm:^9.0.5":"^9.0.9","picomatch@npm:^2.0.4":"^2.3.2","picomatch@npm:^2.3.1":"^2.3.2","picomatch@npm:^4.0.0":"^4.0.4","picomatch@npm:^4.0.2":"^4.0.4","brace-expansion@npm:^1.1.7":"^1.1.13","brace-expansion@npm:^2.0.1":"^2.0.3"},"_nodeVersion":"24.18.0","dependencies":{"ws":"^8.13.0","zod":"^3.23.8","pino":"^9.6","yarn":"^1.22.22","express":"^4.21.2","p-queue":"^9.0.0","libsignal":"^6.0.0","lru-cache":"^11.1.0","node-cron":"^3.0.3","@hapi/boom":"^9.1.3","protobufjs":"^7.5.6","async-mutex":"^0.5.0","music-metadata":"^11.12.3","whatsapp-rust-bridge":"0.5.4","@cacheable/node-cache":"^1.4.0"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.2","devDependencies":{"tsx":"^4.20.3","jest":"^30.0.5","jimp":"^1.6.1","jiti":"^2.4.2","json":"^11.0.0","open":"^8.4.2","eslint":"^9","ts-jest":"^29.4.0","typedoc":"^0.27.9","prettier":"^3.5.3","@types/ws":"^8.0.0","lru-cache":"^11.1.0","supertest":"^7.0.0","@eslint/js":"^9.31.0","release-it":"^20.0.1","typescript":"^5.8.2","@types/jest":"^30.0.0","@types/node":"^20.9.0","pino-pretty":"^13.1.1","tsc-esm-fix":"^3.1.2","@types/express":"^4.17.22","protobufjs-cli":"^1.1.3","link-preview-js":"^3.0.0","@eslint/eslintrc":"^3.3.1","@types/node-cron":"^3.0.11","@types/supertest":"^6.0.3","esbuild-register":"^3.6.0","conventional-changelog":"^7.1.1","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.4.0","typedoc-plugin-markdown":"4.4.2","@atharvh01/eslint-config":"^1.0.0","@typescript-eslint/parser":"^8","conventional-changelog-angular":"^8.0.0","@typescript-eslint/eslint-plugin":"^8"},"peerDependencies":{"jimp":"^1.6.1","sharp":"*","audio-decode":"^2.1.3","link-preview-js":"^3.0.0"},"peerDependenciesMeta":{"jimp":{"optional":true},"audio-decode":{"optional":true},"link-preview-js":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/wakit_2.0.0_1785676374027_0.1726830173284113","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@atharvh01/wakit","version":"2.0.1","keywords":["whatsapp","automation"],"author":{"name":"WAKit"},"license":"MIT","_id":"@atharvh01/wakit@2.0.1","maintainers":[{"name":"atharvh01","email":"atharvhatwar02@gmail.com"}],"homepage":"https://github.com/atharv01h/WAKit/","bugs":{"url":"https://github.com/atharv01h/WAKit/issues"},"dist":{"shasum":"fe89ddf4b085e9b3cdac43e7c63253057a5a37c5","tarball":"https://registry.npmjs.org/@atharvh01/wakit/-/wakit-2.0.1.tgz","fileCount":561,"integrity":"sha512-Lf44EVEaywjaah2t0Hz2O12kI5JqNIort6aAZmlRtqtUozOwe+zbMAP19Q3raMK63qRQhiT/ejo/50C4+n7HOA==","signatures":[{"sig":"MEUCIGwOkPVXQ7VWx948+LUmDzF5lR7I81l9Xu7gMzhcD5cHAiEA1Bpgb3cst+5NglsbHO0Eb9S2QfPJmCpwCWtXuKzV59g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9264582},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"1c7257f52167cdf5bc30bc8ff96958d25e3ad8a1","scripts":{"lint":"tsc && eslint src --ext .js,.ts","test":"node --experimental-vm-modules ./node_modules/.bin/jest --testMatch '**/*.test.ts'","build":"tsc -P tsconfig.build.json && tsc-esm-fix --tsconfig=tsconfig.build.json --ext=.js","format":"prettier --write \"src/**/*.{ts,js,json,md}\"","example":"tsx ./Example/example.ts","prepack":"npm run build","prepare":"npm run build","release":"release-it","lint:fix":"npm run format && npm run lint -- --fix","test:e2e":"NODE_TLS_REJECT_UNAUTHORIZED=0 node --experimental-vm-modules ./node_modules/.bin/jest --runInBand --forceExit --testMatch '**/*.test-e2e.ts'","build:all":"npm run build && npm run build:docs","build:docs":"typedoc","preinstall":"node ./engine-requirements.js","gen:protobuf":"sh WAProto/GenerateStatics.sh","changelog:last":"conventional-changelog -p angular -r 2","update:version":"tsx ./scripts/update-version.ts","changelog:update":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","changelog:preview":"conventional-changelog -p angular -u"},"_npmUser":{"name":"atharvh01","email":"atharvhatwar02@gmail.com"},"repository":{"url":"git+ssh://git@github.com/atharv01h/WAKit.git"},"_npmVersion":"11.19.0","description":"A WebSockets library for interacting with WhatsApp Web","directories":{},"resolutions":{"tar":"^7.5.11","tmp":"^0.2.5","socks":"^2.8.8","flatted":"^3.4.2","basic-ftp":"^5.2.4","handlebars":"^4.7.9","ip-address":"^10.1.1","underscore":"^1.13.8","markdown-it":"^14.1.1","ajv@npm:^6.12.4":"^6.14.0","yaml@npm:^2.6.1":"^2.8.4","glob@npm:^10.2.2":"^10.5.0","glob@npm:^10.5.0":"^10.5.0","glob@npm:^10.3.10":"^10.5.0","js-yaml@npm:^4.1.0":"^4.1.1","js-yaml@npm:^3.13.1":"^3.14.2","minimatch@npm:^3.0.4":"^3.1.5","minimatch@npm:^3.1.2":"^3.1.5","minimatch@npm:^5.0.1":"^5.1.8","minimatch@npm:^9.0.4":"^9.0.9","minimatch@npm:^9.0.5":"^9.0.9","picomatch@npm:^2.0.4":"^2.3.2","picomatch@npm:^2.3.1":"^2.3.2","picomatch@npm:^4.0.0":"^4.0.4","picomatch@npm:^4.0.2":"^4.0.4","brace-expansion@npm:^1.1.7":"^1.1.13","brace-expansion@npm:^2.0.1":"^2.0.3"},"_nodeVersion":"24.18.0","dependencies":{"ws":"^8.13.0","zod":"^3.23.8","pino":"^9.6","yarn":"^1.22.22","express":"^4.21.2","p-queue":"^9.0.0","libsignal":"^6.0.0","lru-cache":"^11.1.0","node-cron":"^3.0.3","@hapi/boom":"^9.1.3","protobufjs":"^7.5.6","async-mutex":"^0.5.0","music-metadata":"^11.12.3","whatsapp-rust-bridge":"0.5.4","@cacheable/node-cache":"^1.4.0"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.2","devDependencies":{"tsx":"^4.20.3","jest":"^30.0.5","jimp":"^1.6.1","jiti":"^2.4.2","json":"^11.0.0","open":"^8.4.2","eslint":"^9","ts-jest":"^29.4.0","typedoc":"^0.27.9","prettier":"^3.5.3","@types/ws":"^8.0.0","lru-cache":"^11.1.0","supertest":"^7.0.0","@eslint/js":"^9.31.0","release-it":"^20.0.1","typescript":"^5.8.2","@types/jest":"^30.0.0","@types/node":"^20.9.0","pino-pretty":"^13.1.1","tsc-esm-fix":"^3.1.2","@types/express":"^4.17.22","protobufjs-cli":"^1.1.3","link-preview-js":"^3.0.0","@eslint/eslintrc":"^3.3.1","@types/node-cron":"^3.0.11","@types/supertest":"^6.0.3","esbuild-register":"^3.6.0","conventional-changelog":"^7.1.1","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.4.0","typedoc-plugin-markdown":"4.4.2","@atharvh01/eslint-config":"^1.0.0","@typescript-eslint/parser":"^8","conventional-changelog-angular":"^8.0.0","@typescript-eslint/eslint-plugin":"^8"},"peerDependencies":{"jimp":"^1.6.1","sharp":"*","audio-decode":"^2.1.3","link-preview-js":"^3.0.0"},"peerDependenciesMeta":{"jimp":{"optional":true},"audio-decode":{"optional":true},"link-preview-js":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/wakit_2.0.1_1785680618585_0.5004858597731003","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@atharvh01/wakit","type":"module","version":"2.0.2","description":"A WebSockets library for interacting with WhatsApp Web","keywords":["whatsapp","automation"],"homepage":"https://github.com/atharv01h/WAKit/","repository":{"url":"git+ssh://git@github.com/atharv01h/WAKit.git"},"license":"MIT","author":{"name":"WAKit"},"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build:all":"npm run build && npm run build:docs","build:docs":"typedoc","build":"tsc -P tsconfig.build.json && tsc-esm-fix --tsconfig=tsconfig.build.json --ext=.js","changelog:last":"conventional-changelog -p angular -r 2","changelog:preview":"conventional-changelog -p angular -u","changelog:update":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","example":"tsx ./Example/example.ts","gen:protobuf":"sh WAProto/GenerateStatics.sh","format":"prettier --write \"src/**/*.{ts,js,json,md}\"","lint":"tsc && eslint src --ext .js,.ts","lint:fix":"npm run format && npm run lint -- --fix","prepack":"npm run build","prepare":"npm run build","preinstall":"node ./engine-requirements.js","release":"release-it","test":"node --experimental-vm-modules ./node_modules/.bin/jest --testMatch '**/*.test.ts'","test:e2e":"NODE_TLS_REJECT_UNAUTHORIZED=0 node --experimental-vm-modules ./node_modules/.bin/jest --runInBand --forceExit --testMatch '**/*.test-e2e.ts'","update:version":"tsx ./scripts/update-version.ts"},"dependencies":{"@cacheable/node-cache":"^1.4.0","@hapi/boom":"^9.1.3","async-mutex":"^0.5.0","express":"^4.21.2","libsignal":"^6.0.0","lru-cache":"^11.1.0","music-metadata":"^11.12.3","node-cron":"^3.0.3","p-queue":"^9.0.0","pino":"^9.6","protobufjs":"^7.5.6","whatsapp-rust-bridge":"0.5.4","ws":"^8.13.0","yarn":"^1.22.22","zod":"^3.23.8"},"devDependencies":{"@atharvh01/eslint-config":"^1.0.0","@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.31.0","@types/express":"^4.17.22","@types/jest":"^30.0.0","@types/node":"^20.9.0","@types/node-cron":"^3.0.11","@types/supertest":"^6.0.3","@types/ws":"^8.0.0","@typescript-eslint/eslint-plugin":"^8","@typescript-eslint/parser":"^8","conventional-changelog":"^7.1.1","conventional-changelog-angular":"^8.0.0","esbuild-register":"^3.6.0","eslint":"^9","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.4.0","jest":"^30.0.5","jimp":"^1.6.1","jiti":"^2.4.2","json":"^11.0.0","link-preview-js":"^3.0.0","lru-cache":"^11.1.0","open":"^8.4.2","pino-pretty":"^13.1.1","prettier":"^3.5.3","protobufjs-cli":"^1.1.3","release-it":"^20.0.1","supertest":"^7.0.0","ts-jest":"^29.4.0","tsc-esm-fix":"^3.1.2","tsx":"^4.20.3","typedoc":"^0.27.9","typedoc-plugin-markdown":"4.4.2","typescript":"^5.8.2"},"peerDependencies":{"audio-decode":"^2.1.3","jimp":"^1.6.1","link-preview-js":"^3.0.0","sharp":"*"},"resolutions":{"ajv@npm:^6.12.4":"^6.14.0","basic-ftp":"^5.2.4","brace-expansion@npm:^1.1.7":"^1.1.13","brace-expansion@npm:^2.0.1":"^2.0.3","flatted":"^3.4.2","glob@npm:^10.2.2":"^10.5.0","glob@npm:^10.3.10":"^10.5.0","glob@npm:^10.5.0":"^10.5.0","handlebars":"^4.7.9","ip-address":"^10.1.1","js-yaml@npm:^3.13.1":"^3.14.2","js-yaml@npm:^4.1.0":"^4.1.1","markdown-it":"^14.1.1","minimatch@npm:^3.0.4":"^3.1.5","minimatch@npm:^3.1.2":"^3.1.5","minimatch@npm:^5.0.1":"^5.1.8","minimatch@npm:^9.0.4":"^9.0.9","minimatch@npm:^9.0.5":"^9.0.9","picomatch@npm:^2.0.4":"^2.3.2","picomatch@npm:^2.3.1":"^2.3.2","picomatch@npm:^4.0.0":"^4.0.4","picomatch@npm:^4.0.2":"^4.0.4","socks":"^2.8.8","tar":"^7.5.11","tmp":"^0.2.5","underscore":"^1.13.8","yaml@npm:^2.6.1":"^2.8.4"},"peerDependenciesMeta":{"audio-decode":{"optional":true},"jimp":{"optional":true},"link-preview-js":{"optional":true}},"packageManager":"yarn@4.9.2","engines":{"node":">=20.0.0"},"gitHead":"23134c8d2c20dcfbb0e58336a78dd4cbec6ecaa8","_id":"@atharvh01/wakit@2.0.2","bugs":{"url":"https://github.com/atharv01h/WAKit/issues"},"_nodeVersion":"24.18.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-y8zmDJS4aPyBj7dwiGlz6GnCiDwbpuYS1vw1mcEm7JXn3rCFcbk+p4EOBPityDlI38xzSrb7PbBlTUv1E6neog==","shasum":"f1e6d5f3fc03870c0a0ac35871b0692a31966422","tarball":"https://registry.npmjs.org/@atharvh01/wakit/-/wakit-2.0.2.tgz","fileCount":561,"unpackedSize":9269658,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDSy2uwQrJnVhmZnmP5uc1sFljC19Oy3+aED6ZgwHo4dAIgLGdz7TGA9EW68JE7u4C7REjap9rD3AHzqCDlKVvm7Ik="}]},"_npmUser":{"name":"atharvh01","email":"atharvhatwar02@gmail.com"},"directories":{},"maintainers":[{"name":"atharvh01","email":"atharvhatwar02@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wakit_2.0.2_1785741599204_0.5037838026013368"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-01T09:50:32.862Z","modified":"2026-08-03T07:19:59.516Z","1.0.1":"2026-08-01T09:50:33.299Z","1.0.2":"2026-08-02T10:33:41.228Z","1.0.4":"2026-08-02T10:44:24.810Z","1.0.6":"2026-08-02T11:31:22.630Z","1.0.7":"2026-08-02T11:35:15.257Z","1.0.8":"2026-08-02T13:03:57.262Z","2.0.0":"2026-08-02T13:12:54.213Z","2.0.1":"2026-08-02T14:23:38.806Z","2.0.2":"2026-08-03T07:19:59.389Z"},"bugs":{"url":"https://github.com/atharv01h/WAKit/issues"},"author":{"name":"WAKit"},"license":"MIT","homepage":"https://github.com/atharv01h/WAKit/","keywords":["whatsapp","automation"],"repository":{"url":"git+ssh://git@github.com/atharv01h/WAKit.git"},"description":"A WebSockets library for interacting with WhatsApp Web","maintainers":[{"name":"atharvh01","email":"atharvhatwar02@gmail.com"}],"readme":"<div align=\"center\">\n  <h1>WAKit</h1>\n  <p><strong>A modern, powerful, and developer-friendly WebSockets library for WhatsApp Web.</strong></p>\n\n  [![npm version](https://img.shields.io/npm/v/@atharvh01/wakit.svg)](https://www.npmjs.com/package/@atharvh01/wakit)\n  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n</div>\n\n> 🚧 **WAKit is currently under active development.**\n> While the library is functional and highly capable, some features may still contain bugs or change before stable releases. Bug reports, feature requests, and pull requests are highly appreciated.\n\n---\n\n## 📑 Table of Contents\n- [Introduction](#-introduction)\n- [Why WAKit?](#-why-wakit)\n- [What's New in WAKit](#-whats-new-in-wakit)\n- [Comparison](#️-comparison)\n- [Features](#-features)\n- [Installation](#-installation)\n- [Quick Start](#-quick-start)\n- [Usage Examples](#-usage-examples)\n- [Project Structure](#-project-structure)\n- [API Overview](#-api-overview)\n- [Performance](#-performance)\n- [FAQ](#-faq)\n- [Known Limitations](#️-known-limitations)\n- [Roadmap](#️-roadmap)\n- [Contributing](#-contributing)\n- [License](#-license)\n- [Creator](#-creator)\n\n---\n\n## 👋 Introduction\n\n**WAKit** is a complete typescript-based WebSockets client for the WhatsApp Web protocol. It speaks the binary Noise/protobuf protocol directly—meaning there are no heavy browser automation tools like Puppeteer or Selenium required. \n\nOriginally built as a modern evolution of the popular Baileys library, WAKit takes the heavy lifting out of WhatsApp automation by providing a radically simplified API, robust plugin architecture, and enterprise-grade middleware pipelines.\n\nWhether you are building simple chat bots, complex customer support tools, or advanced integrations, WAKit provides a clean, predictable, and highly scalable foundation.\n\n---\n\n## 🚀 Why WAKit?\n\nWAKit was born out of a need for better developer ergonomics. While traditional libraries give you raw access to the protocol, they often leave you to handle complex state management, reconnection logic, and event routing yourself. \n\nWAKit introduces:\n- **Better Developer Experience:** A highly abstracted `createClient` API that hides boilerplate.\n- **Cleaner APIs:** Say goodbye to deeply nested configuration objects and sprawling event listeners.\n- **Easier Onboarding:** Start sending messages in less than 5 lines of code.\n- **Better Organization:** Dedicated modules for Middleware, Plugins, Storage, and Telemetry.\n\n---\n\n## ✨ What's New in WAKit\n\nWAKit introduces several next-generation architectural improvements over standard clients:\n\n- **Next-Gen `WAKitClient`:** A unified client wrapper (`createClient`) that handles authentication and socket lifecycle automatically.\n- **Middleware Pipeline:** Intercept, modify, rate-limit, and log incoming and outgoing messages seamlessly. Includes built-in `dedupMiddleware`, `rateLimitMiddleware`, and group-scoped pipelines.\n- **Plugin System (`definePlugin`):** A robust lifecycle system (`initialize`, `install`, `ready`, `destroy`) with dependency checking. Includes built-in `LoggerPlugin` and `WebhookPlugin`.\n- **REST API Generator:** Expose WAKit via an Express server dynamically. Includes API key auth, rate-limiting, and an auto-generated Swagger UI (`/docs`) and OpenAPI 3.1 spec.\n- **Job Scheduler:** A `node-cron` powered task runner attached directly to the client. Schedule recurring jobs, one-shot WhatsApp message sends, and persist job state across restarts.\n- **Event Recorder & Replay:** Log every socket event to disk and replay them offline at varying speeds (or step-by-step) for ultimate debugging without needing a live device connection.\n- **Pluggable Storage:** Native `MemoryStore` and `JsonFileStore` for managing authentication credentials.\n\n---\n\n## ⚖️ Comparison\n\n| Feature | Baileys | WAKit |\n|----------|----------|--------|\n| JavaScript Support | ✅ | ✅ |\n| TypeScript Support | ✅ | ✅ |\n| Developer Experience | Good | **Excellent** |\n| API Simplicity | Low-level socket | **High-level Client** |\n| Plugin Ecosystem | ❌ | ✅ **Native Plugin Registry** |\n| Message Middleware | ❌ | ✅ **Native Pipeline** |\n| Code Organization | Monolithic | **Modular Domain Driven** |\n| Storage Adapters | Manual implementation | **Built-in `JsonFileStore` & `MemoryStore`** |\n| Rate Limiting | Bring-your-own | **Built-in Middleware** |\n| Learning Curve | Steep | **Beginner Friendly** |\n\n---\n\n## 🛠 Features\n\n- **Direct Protocol Communication:** Fast, lightweight WebSocket connections without browsers.\n- **Multi-Device Support:** Full compatibility with the latest WhatsApp Multi-Device architecture.\n- **Rich Message Support:** Send text, images, videos, documents, audio, and contacts.\n- **Interactive Messages:** Full support for polls and reactions.\n- **Authentication:** QR code generation and 8-digit Pairing Code support.\n- **Group Management:** Create groups, update metadata, manage admins, and handle invites.\n- **Next-Gen Abstractions:** Middleware, Plugins, Event Bus, and Circuit Breakers.\n\n---\n\n## 📦 Installation\n\nWAKit requires **Node.js ≥ 20.0.0**.\n\nUsing your favorite package manager:\n\n```bash\nnpm install @atharvh01/wakit\n```\n\n```bash\nyarn add @atharvh01/wakit\n```\n\n```bash\npnpm add @atharvh01/wakit\n```\n\n```bash\nbun add @atharvh01/wakit\n```\n\n---\n\n## ⚡ Quick Start\n\nGet your bot up and running in under a minute using the new `createClient` API:\n\n```typescript\nimport { createClient } from '@atharvh01/wakit';\n\nasync function start() {\n    // Automatically creates/loads auth state from the provided directory\n    const client = await createClient({ auth: './my-auth-session' });\n\n    // Listen for incoming messages\n    client.on('messages.upsert', async (event) => {\n        const msg = event.messages[0];\n        \n        // Ignore messages from ourselves\n        if (msg.key.fromMe) return;\n\n        const text = msg.message?.conversation || msg.message?.extendedTextMessage?.text;\n\n        if (text === 'ping') {\n            await client.sendMessage(msg.key.remoteJid!, { text: 'pong!' });\n        }\n    });\n}\n\nstart();\n```\n\n*(Note: The first time you run this, a QR code will be printed to your console. Scan it with your WhatsApp mobile app to link the device.)*\n\n---\n\n## 📘 Usage Examples\n\n<details>\n<summary><strong>Authentication via Pairing Code (No QR)</strong></summary>\n\n```typescript\nimport { createClient } from '@atharvh01/wakit';\nimport readline from 'readline';\n\nconst rl = readline.createInterface({ input: process.stdin, output: process.stdout });\nconst question = (text: string) => new Promise<string>((resolve) => rl.question(text, resolve));\n\nconst client = await createClient({ auth: './pairing-session' });\n\n// Request code if not registered\nif (!client.authState.creds.registered) {\n    const phoneNumber = await question('Please enter your phone number (e.g. 1234567890):\\n');\n    const code = await client.requestPairingCode(phoneNumber);\n    console.log(`Your pairing code is: ${code}`);\n}\n```\n</details>\n\n<details>\n<summary><strong>Using Middleware (Rate Limiting)</strong></summary>\n\n```typescript\nimport { createClient, rateLimitMiddleware } from '@atharvh01/wakit';\n\nconst client = await createClient({ auth: './session' });\n\n// Limit incoming messages to 10 per minute per JID\nclient.useIncoming(rateLimitMiddleware({ maxPerWindow: 10, windowMs: 60_000 }));\n```\n</details>\n\n<details>\n<summary><strong>Writing a Custom Plugin</strong></summary>\n\n```typescript\nimport { createClient, definePlugin } from '@atharvh01/wakit';\n\nconst helloPlugin = definePlugin({\n    name: 'hello-world',\n    version: '1.0.0',\n    async install(client) {\n        client.on('messages.upsert', async (event) => {\n            console.log(`Received message from ${event.messages[0].key.remoteJid}`);\n        });\n    }\n});\n\nconst client = await createClient({ auth: './session' });\nawait client.use(helloPlugin);\n```\n</details>\n\n<details>\n<summary><strong>Legacy Compatibility (makeWASocket)</strong></summary>\nIf you are migrating from Baileys, the original `makeWASocket` API is still fully exported and backward compatible!\n\n```typescript\nimport makeWASocket, { useMultiFileAuthState } from '@atharvh01/wakit';\n\nconst { state, saveCreds } = await useMultiFileAuthState('auth');\nconst sock = makeWASocket({ auth: state });\n\nsock.ev.on('creds.update', saveCreds);\n```\n</details>\n\n---\n\n## 📂 Project Structure\n\n```\nWAKit/\n ├── src/\n │   ├── client/       # Next-gen WAKitClient wrapper\n │   ├── Middleware/   # Interceptors, rate limiters, logging pipelines\n │   ├── Plugins/      # Plugin registry and ecosystem logic\n │   ├── Storage/      # MemoryStore and JsonFileStore adapters\n │   ├── Socket/       # Low-level Noise protocol and socket lifecycle\n │   ├── Utils/        # Decoders, Crypto, Circuit Breakers, Event Bus\n │   └── WAProto/      # Generated Protobuf schemas\n └── Example/          # Reference implementations\n```\n\n---\n\n## 🔍 API Overview\n\n- `createClient(config)`: The modern entrypoint for WAKit. Returns a `WAKitClient`.\n- `client.use(plugin)`: Register a plugin.\n- `client.api.start()`: Spin up the WAKit REST API server.\n- `client.scheduler.cron(...)`: Schedule background jobs or automated messages.\n- `client.recorder.start()`: Begin capturing all WhatsApp events for debugging.\n- `makeWASocket(config)`: The low-level socket constructor (Baileys compatible).\n- `definePlugin(plugin)`: Type-safe plugin constructor.\n- `createPipeline()`: Instantiates a middleware pipeline for message interception.\n- `MemoryStore` / `JsonFileStore`: Implementations of `WAKitStore` for session management.\n\n---\n\n## ⚡ Performance\n\nWAKit introduces robust structural enhancements to maintain performance at scale:\n- **Bracket-pattern resource cleanup:** Memory leaks common in long-running socket connections have been heavily patched.\n- **Native BigInt conversions:** Protobuf long decoding now utilizes native V8 `BigInt` mappings directly in `longToNumber` resulting in faster binary unmarshalling.\n- **CacheStore Integration:** Signal Keys and retry counters are cached using `@cacheable/node-cache` preventing redundant disk/network I/O.\n\n---\n\n## ❓ FAQ\n\n**Q: Can I use WAKit in the browser?**  \nA: No. WAKit communicates directly via raw TCP/WebSockets and requires a Node.js environment (specifically for crypto and filesystem operations).\n\n**Q: Will Baileys plugins work with WAKit?**  \nA: Because WAKit retains backward compatibility with `makeWASocket`, most logic written for Baileys will drop-in perfectly. However, for future development, we recommend using WAKit's native `definePlugin` API.\n\n**Q: Can this be used for mass messaging or spam?**  \nA: Absolutely not. We do not accept or support usage whose primary purpose is to enable abuse or evade WhatsApp's anti-spam mechanisms.\n\n---\n\n## ⚠️ Known Limitations\n\n- **Evolving APIs:** The next-gen APIs (`WAKitClient`, `Plugins`, `Middleware`) are actively being fleshed out. Expect minor additions and improvements over the next few releases.\n- **E2E Encryption Sync:** Heavy history syncs (fetching years of old messages) can be resource-intensive during initial device linking.\n\n---\n\n## 🗺️ Roadmap\n\n- [x] Complete Next-Gen `WAKitClient` wrapper.\n- [x] Middleware system with named pipelines.\n- [x] Plugin Registry and lifecycle.\n- [x] Integrated Express REST API Generator & Swagger UI.\n- [x] Event Recorder and Time-travel Replay.\n- [x] Built-in Job Scheduler.\n- [x] Pluggable Storage Adapters (`JsonFileStore`).\n- [ ] First-class Database Adapters (PostgreSQL/Redis) natively included.\n\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! To get started:\n\n1. **Fork** the repository.\n2. **Branch** off `main` (`git checkout -b feat/my-new-feature`).\n3. Ensure all tests and linting pass (`yarn lint` & `yarn test`).\n4. **Commit** using Conventional Commits.\n5. Submit a **Pull Request**.\n\nPlease read `AGENTS.md` and `CODE_OF_CONDUCT.md` for our strict guidelines on code style, AI authorship, and anti-spam policies.\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT License**.\n\n---\n\n## 👤 Creator\n\n**Atharv Hatwar**  \n*Open Source Developer*\n","readmeFilename":"README.md"}