{"_id":"@bthn/waha-api-client-ts","_rev":"3-cce85a341460d2d80862957d41b4a23b","name":"@bthn/waha-api-client-ts","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.3":{"name":"@bthn/waha-api-client-ts","version":"1.0.3","keywords":["waha","api","client","whatsapp","typescript"],"author":"","license":"ISC","_id":"@bthn/waha-api-client-ts@1.0.3","maintainers":[{"name":"bthn","email":"katircib@gmail.com"}],"homepage":"https://github.com/myusp/waha-api-client-ts#readme","bugs":{"url":"https://github.com/myusp/waha-api-client-ts/issues"},"dist":{"shasum":"b5745323d5f936d6456a0222af89389418c878ee","tarball":"https://registry.npmjs.org/@bthn/waha-api-client-ts/-/waha-api-client-ts-1.0.3.tgz","fileCount":16,"integrity":"sha512-BclQnOrLfhz1seRLh6ZnHdYxrl+Gl5PsSND/shu79veDfgi2KBBPAQgoi0IpD0Iu0Xe91YIkJv68c0UdaHZcHw==","signatures":[{"sig":"MEYCIQCSwwvmicOIEakZv407d3oxlgwA9gpoI3HYMLOXejzchwIhALSgPYRLOsSGpufGBWWsuVT5oktNusvGdN21c1Sn2JeD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":811095},"main":"dist/index.cjs.js","type":"module","types":"dist/index.d.ts","unpkg":"dist/index.umd.min.js","module":"dist/index.esm.js","browser":"dist/index.umd.min.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","browser":"./dist/index.umd.min.js","require":"./dist/index.cjs.js"}},"gitHead":"5368580f172cdceb58af65345ffb4a8b5f324f75","scripts":{"docs":"typedoc src/index.ts --out docs --excludePrivate --excludeInternal","test":"tsx example/index.ts","build":"rollup -c","clean":"rm -rf dist","prepare":"npm run build","prebuild":"npm run generate:types","build:watch":"rollup -c --watch","build:browser":"rollup -c --environment TARGET:browser","generate:types":"npx sta generate -p waha-openapi.json -o src/generated -n waha-schema.ts --no-client --type-suffix=Schema"},"_npmUser":{"name":"bthn","email":"katircib@gmail.com"},"repository":{"url":"git+https://github.com/myusp/waha-api-client-ts.git","type":"git"},"_npmVersion":"11.6.2","description":"Waha Api Client TS for https://github.com/devlikeapro/waha (unofficial)","directories":{},"_nodeVersion":"25.2.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","tslib":"^2.8.1","rollup":"^4.52.4","terser":"^5.44.0","typedoc":"^0.28.14","typescript":"^5.9.3","@types/node":"^24.7.2","rollup-plugin-dts":"^6.2.3","openapi-typescript":"^7.10.1","@rollup/plugin-terser":"^0.4.4","swagger-typescript-api":"^13.2.15","@rollup/plugin-commonjs":"^28.0.8","@rollup/plugin-typescript":"^12.1.4","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"tmp":"tmp/waha-api-client-ts_1.0.3_1771072114567_0.7134177774777608","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@bthn/waha-api-client-ts","version":"1.0.4","keywords":["waha","api","client","whatsapp","typescript"],"author":"","license":"ISC","_id":"@bthn/waha-api-client-ts@1.0.4","maintainers":[{"name":"bthn","email":"katircib@gmail.com"}],"homepage":"https://github.com/myusp/waha-api-client-ts#readme","bugs":{"url":"https://github.com/myusp/waha-api-client-ts/issues"},"dist":{"shasum":"2c7db119298a5f494cb950ec877979b9f9cd83b1","tarball":"https://registry.npmjs.org/@bthn/waha-api-client-ts/-/waha-api-client-ts-1.0.4.tgz","fileCount":16,"integrity":"sha512-r+hjy8Rjdwokv/fZxCBiWz1YbR0/FjCmKVD/0iuWrUGPJeZzYPfDcwNOF+uS8rEGujrXM6wIXyADtkIhiNdm5Q==","signatures":[{"sig":"MEQCIAfTu0wD6jnIpFrkNylJ0Bkdfg/AY6/qeGDiSSqTseA1AiBY5PngaipMOHhpF4WqflAg+SUsTcj0mhtZFgy/tUMuyA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":810918},"main":"dist/index.cjs.js","type":"module","types":"dist/index.d.ts","unpkg":"dist/index.umd.min.js","module":"dist/index.esm.js","browser":"dist/index.umd.min.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","browser":"./dist/index.umd.min.js","require":"./dist/index.cjs.js"}},"gitHead":"5368580f172cdceb58af65345ffb4a8b5f324f75","scripts":{"docs":"typedoc src/index.ts --out docs --excludePrivate --excludeInternal","test":"tsx example/index.ts","build":"rollup -c","clean":"rm -rf dist","prepare":"npm run build","prebuild":"npm run generate:types","build:watch":"rollup -c --watch","build:browser":"rollup -c --environment TARGET:browser","generate:types":"npx sta generate -p waha-openapi.json -o src/generated -n waha-schema.ts --no-client --type-suffix=Schema"},"_npmUser":{"name":"bthn","email":"katircib@gmail.com"},"repository":{"url":"git+https://github.com/myusp/waha-api-client-ts.git","type":"git"},"_npmVersion":"11.6.2","description":"Waha Api Client TS for https://github.com/devlikeapro/waha (unofficial)","directories":{},"_nodeVersion":"25.2.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","tslib":"^2.8.1","rollup":"^4.52.4","terser":"^5.44.0","typedoc":"^0.28.14","typescript":"^5.9.3","@types/node":"^24.7.2","rollup-plugin-dts":"^6.2.3","openapi-typescript":"^7.10.1","@rollup/plugin-terser":"^0.4.4","swagger-typescript-api":"^13.2.15","@rollup/plugin-commonjs":"^28.0.8","@rollup/plugin-typescript":"^12.1.4","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"tmp":"tmp/waha-api-client-ts_1.0.4_1771072775456_0.8554072916453339","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@bthn/waha-api-client-ts","version":"1.0.5","type":"module","description":"Waha Api Client TS for https://github.com/devlikeapro/waha (unofficial)","main":"dist/index.cjs.js","module":"dist/index.esm.js","browser":"dist/index.umd.min.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.cjs.js","browser":"./dist/index.umd.min.js","types":"./dist/index.d.ts"}},"unpkg":"dist/index.umd.min.js","scripts":{"build":"rollup -c","build:browser":"rollup -c --environment TARGET:browser","build:watch":"rollup -c --watch","test":"tsx example/index.ts","prepare":"npm run build","docs":"typedoc src/index.ts --out docs --excludePrivate --excludeInternal","clean":"rm -rf dist","generate:types":"npx sta generate -p waha-openapi.json -o src/generated -n waha-schema.ts --no-client --type-suffix=Schema","prebuild":"npm run generate:types"},"keywords":["waha","api","client","whatsapp","typescript"],"author":"","license":"ISC","repository":{"type":"git","url":"git+https://github.com/myusp/waha-api-client-ts.git"},"devDependencies":{"@rollup/plugin-commonjs":"^28.0.8","@rollup/plugin-node-resolve":"^16.0.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^12.1.4","@types/node":"^24.7.2","openapi-typescript":"^7.10.1","rollup":"^4.52.4","rollup-plugin-dts":"^6.2.3","swagger-typescript-api":"^13.2.15","terser":"^5.44.0","tslib":"^2.8.1","tsx":"^4.20.6","typedoc":"^0.28.14","typescript":"^5.9.3"},"gitHead":"5368580f172cdceb58af65345ffb4a8b5f324f75","_id":"@bthn/waha-api-client-ts@1.0.5","bugs":{"url":"https://github.com/myusp/waha-api-client-ts/issues"},"homepage":"https://github.com/myusp/waha-api-client-ts#readme","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-5DdRGXZ+WcJp51q4wILSRK/11GOlX74zFTrWk6nLAP3cNHoLA2nLcT+VU3A0ySX19WqSmSyawnc4Lcdn4o260A==","shasum":"dce68d1f7e75e6b9cdeced2028160403108eb6d5","tarball":"https://registry.npmjs.org/@bthn/waha-api-client-ts/-/waha-api-client-ts-1.0.5.tgz","fileCount":16,"unpackedSize":811500,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBb36oYgmQbIMckBYMXmsBtTwo6jNgmmqTe2e1FOxw/kAiAxmXWk4ILQQYmHILx4cfKvC/OVUPFvGZF7rx49fDOEYQ=="}]},"_npmUser":{"name":"bthn","email":"katircib@gmail.com"},"directories":{},"maintainers":[{"name":"bthn","email":"katircib@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/waha-api-client-ts_1.0.5_1771073043091_0.40985138102572893"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-14T12:28:34.463Z","modified":"2026-02-14T12:44:03.383Z","1.0.3":"2026-02-14T12:28:34.751Z","1.0.4":"2026-02-14T12:39:35.662Z","1.0.5":"2026-02-14T12:44:03.279Z"},"bugs":{"url":"https://github.com/myusp/waha-api-client-ts/issues"},"license":"ISC","homepage":"https://github.com/myusp/waha-api-client-ts#readme","keywords":["waha","api","client","whatsapp","typescript"],"repository":{"type":"git","url":"git+https://github.com/myusp/waha-api-client-ts.git"},"description":"Waha Api Client TS for https://github.com/devlikeapro/waha (unofficial)","maintainers":[{"name":"bthn","email":"katircib@gmail.com"}],"readme":"# waha-api-client-ts\n\nTypeScript client library for [WAHA (WhatsApp HTTP API)](https://github.com/devlikeapro/waha) - Unofficial\n\n**✨ This library is fully auto-generated and maintained by GitHub Copilot**\n\n## Features\n\n- ✅ **Complete API Coverage**: All 147 WAHA API endpoints implemented\n- � **Auto-Generated Types**: 200+ TypeScript types generated from OpenAPI schema\n- �🌐 **Universal Compatibility**: Works in both Node.js and browser environments\n- 🚫 **Zero Dependencies**: No axios or other HTTP libraries - uses native fetch API\n- 🔑 **Default Configuration**: Set API key, base URL, and default session on initialization\n- 🔄 **Config Override**: Override session, timeout, retry attempts, and retry delay per API call\n- 🔁 **Automatic Retries**: Built-in retry logic with configurable attempts and delays\n- 📝 **Fully Typed**: Complete TypeScript support with JSDoc comments\n- 🚀 **Easy to Use**: Simple and intuitive API\n- 🛡️ **Safe Send Methods**: Built-in number verification to prevent blocking\n\n## Installation\n\n```bash\nnpm install waha-api-client-ts\n```\n\n## Bundles and Compatibility\n\nThis package ships multiple bundle formats so it works both in Node.js and in web browsers:\n\n- dist/index.cjs.js — CommonJS (Node require)\n- dist/index.esm.js — ES Module (Node & modern bundlers)\n- dist/index.cjs.min.js / dist/index.esm.min.js — Minified versions\n- dist/index.umd.js / dist/index.umd.min.js — UMD bundle for browsers (script tag / CDN)\n\nThe package.json `browser` and `unpkg` entry point point to the UMD minified bundle for CDN usage.\n\n## Usage\n\n### Node (ESM import)\n\n```js\nimport { WAHAClient } from 'waha-api-client-ts';\n\nconst client = new WAHAClient({ baseURL: 'https://your-waha-instance.com' });\n```\n\n### Node (CommonJS require)\n\n```js\nconst { WAHAClient } = require('waha-api-client-ts');\nconst client = new WAHAClient({ baseURL: 'https://your-waha-instance.com' });\n```\n\n### Browser (ES Module)\n\nIf your app supports ES modules in the browser, you can import the ESM build directly from a bundler or local server:\n\n```html\n<script type=\"module\">\n  import { WAHAClient } from '/node_modules/waha-api-client-ts/dist/index.esm.js';\n  const client = new WAHAClient({ baseURL: 'https://your-waha-instance.com' });\n  // use client...\n</script>\n```\n\n### Browser (UMD Global via CDN or local file)\n\nInclude the UMD bundle and access the library via the global name (package name or `WAHA`):\n\n```html\n<script src=\"https://unpkg.com/waha-api-client-ts@latest/dist/index.umd.min.js\"></script>\n<script>\n  // If package name is not a valid JS identifier the global is also available as 'WAHA'\n  const client = (window.WAHA || window['waha-api-client-ts']).WAHAClient\n    ? new (window.WAHA || window['waha-api-client-ts']).WAHAClient({ baseURL: 'https://...' })\n    : null;\n  // use client...\n</script>\n```\n\n## Development & Building\n\nTypes are generated from the included OpenAPI specification. Regenerate types and build the library with:\n\n```bash\n# regenerate types from OpenAPI\nnpm run generate:types\n\n# build all bundles (CJS/ESM/UMD + d.ts)\nnpm run build\n\n# or build only browser-targeted bundles\nnpm run build:browser\n```\n\nThe build process will output files to `dist/` including `index.d.ts` for TypeScript consumers.\n\n\n## Quick Start\n\n```typescript\nimport { WAHAClient } from 'waha-api-client-ts';\n\n// Initialize client with default configuration\nconst client = new WAHAClient({\n  baseURL: 'https://your-waha-instance.com',\n  apiKey: 'your-api-key',\n  session: 'default',\n  timeout: 30000,\n  retryAttempts: 3,\n  retryDelay: 1000,\n});\n\n// Send a text message\nawait client.sendText({\n  chatId: '1234567890@c.us',\n  text: 'Hello from WAHA!',\n});\n```\n\n## Configuration\n\n### Default Configuration\n\nWhen initializing the client, you can set default values:\n\n```typescript\nconst client = new WAHAClient({\n  baseURL: 'https://your-waha-instance.com',  // Required: Your WAHA API base URL\n  apiKey: 'your-api-key',                     // Optional: API key for authentication\n  session: 'default',                          // Optional: Default session name (default: 'default')\n  timeout: 30000,                              // Optional: Request timeout in ms (default: 30000)\n  retryAttempts: 3,                            // Optional: Number of retry attempts (default: 3)\n  retryDelay: 1000,                            // Optional: Delay between retries in ms (default: 1000)\n});\n```\n\n### Per-Request Configuration Override\n\nYou can override configuration for individual API calls:\n\n```typescript\nawait client.sendText({\n  chatId: '1234567890@c.us',\n  text: 'Hello!',\n  config: {\n    session: 'custom-session',      // Override session for this request\n    timeout: 60000,                  // Override timeout for this request\n    retryAttempts: 5,                // Override retry attempts\n    retryDelay: 2000,                // Override retry delay\n  },\n});\n```\n\n## Safe Send Methods (Avoid Blocking)\n\nTo prevent your WhatsApp account from being blocked, it's recommended to check if a number is registered on WhatsApp before sending messages. This library provides \"safe send\" methods that automatically implement WhatsApp's anti-blocking best practices.\n\n### Why Use Safe Send?\n\nWhen you send messages to numbers that don't exist on WhatsApp, it can lead to your account being flagged or blocked. Safe send methods help prevent this by implementing the following anti-blocking measures:\n\n1. **Number Verification**: Checks if the number is registered on WhatsApp before sending\n2. **Seen Receipt**: Sends a \"seen\" indicator to appear more human-like\n3. **Typing Indicators**: Shows \"typing...\" with realistic delays based on message type and length\n4. **Random Delays**: Adds random delays between actions to simulate human behavior\n5. **Smart Timing**: Calculates appropriate delays based on message length (1-5 seconds for text, 2-6 seconds for media)\n\nThese methods return `null` if the number doesn't exist, preventing failed delivery attempts that could flag your account.\n\n**Delay Timings:**\n- Text messages: 1-5 seconds (calculated based on message length)\n- Images: 2-4 seconds\n- Videos: 3-6 seconds  \n- Files: 2-5 seconds\n- Voice, Location, Contacts, Buttons, Lists, Polls: 1.5-3 seconds\n\n### Available Safe Send Methods\n\nAll safe send methods follow the same pattern: they check the number status first, then send only if the number exists.\n\n- `safeSendText()` - Safe version of `sendText()`\n- `safeSendImage()` - Safe version of `sendImage()`\n- `safeSendFile()` - Safe version of `sendFile()`\n- `safeSendVoice()` - Safe version of `sendVoice()`\n- `safeSendVideo()` - Safe version of `sendVideo()`\n- `safeSendLocation()` - Safe version of `sendLocation()`\n- `safeSendContactVcard()` - Safe version of `sendContactVcard()`\n- `safeSendLinkPreview()` - Safe version of `sendLinkPreview()`\n- `safeSendButtons()` - Safe version of `sendButtons()`\n- `safeSendList()` - Safe version of `sendList()`\n- `safeSendPoll()` - Safe version of `sendPoll()`\n\n### How Safe Send Works\n\nWhen you call a safe send method, the following sequence occurs automatically:\n\n1. **Verify Number**: Check if the recipient's number exists on WhatsApp\n2. **Send Seen**: Mark the chat as \"seen\" (if applicable)\n3. **Start Typing**: Show typing indicator in the chat\n4. **Wait**: Realistic delay based on message type (see \"Delay Timings\" above: 1-6 seconds depending on content)\n5. **Stop Typing**: Hide typing indicator\n6. **Send Message**: Deliver the actual message\n\nThis mimics human behavior and significantly reduces the risk of being flagged as a bot or spam account.\n\n### Safe Send Usage Examples\n\n```typescript\n// Safe send text message with anti-blocking measures\nconst result = await client.safeSendText({\n  chatId: '1234567890@c.us',\n  text: 'Hello! How are you?',\n});\n\nif (result === null) {\n  console.log('Number does not exist on WhatsApp - message not sent');\n} else {\n  console.log('Message sent successfully with anti-blocking measures:', result);\n}\n\n// Safe send image with anti-blocking measures\nconst imageResult = await client.safeSendImage({\n  chatId: '1234567890@c.us',\n  file: 'https://example.com/image.jpg',\n  caption: 'Check this out!',\n});\n\nif (imageResult === null) {\n  console.log('Number does not exist on WhatsApp - image not sent');\n} else {\n  console.log('Image sent successfully:', imageResult);\n}\n\n// Safe send file with anti-blocking measures\nconst fileResult = await client.safeSendFile({\n  chatId: '1234567890@c.us',\n  file: 'https://example.com/document.pdf',\n  filename: 'document.pdf',\n  caption: 'Important document',\n});\n\nif (fileResult === null) {\n  console.log('Number does not exist on WhatsApp - file not sent');\n} else {\n  console.log('File sent successfully:', fileResult);\n}\n```\n\n### Anti-Blocking Best Practices\n\nFollowing WhatsApp's guidelines to avoid getting blocked:\n\n✅ **DO:**\n- Use safe send methods for new/unknown contacts\n- Add random delays between messages (the safe send methods do this automatically)\n- Only reply to messages, never initiate conversations with strangers\n- Send personalized messages that vary in content\n- Respect rate limits (maximum 4 messages per hour per contact is a safe guideline - exceeding this may trigger spam detection)\n- Have a profile picture and status\n- Use HTTPS URLs and avoid previously marked spam links\n\n❌ **DON'T:**\n- Send messages to numbers not on WhatsApp\n- Send bulk messages without delays\n- Use the same message template repeatedly\n- Send messages 24/7 without breaks\n- Send long texts or multiple messages to new contacts\n- Ignore user reports (if users block/report you, stop messaging them)\n\n### When to Use Safe Send vs Regular Send\n\n- **Use Safe Send** when:\n  - Sending to numbers from external sources (databases, forms, APIs)\n  - You're not sure if the number is on WhatsApp\n  - You want maximum protection against blocking\n  - You're doing any form of bulk messaging\n  - Initiating conversations with new contacts\n  - Building a bot or automated system\n\n- **Use Regular Send** when:\n  - Sending to group chats (groups don't need number verification)\n  - Replying to received messages (they initiated the conversation)\n  - You're certain the number exists and you have an ongoing conversation\n  - You need minimal latency and have already verified the number\n  - Sending to your own saved contacts from your phone\n\n## API Methods\n\nThis client implements all 147 WAHA API endpoints organized into the following categories:\n\n### 🔑 Authentication (2 methods)\n- `getQR()` - Get QR code for pairing\n- `requestCode()` - Request authentication code\n\n### 🖥️ Session Management (13 methods)\n- `getSessions()` - Get all sessions\n- `getSession()` - Get session info\n- `createSession()` - Create new session\n- `updateSession()` - Update session config\n- `deleteSession()` - Delete session\n- `startSession()` / `startSessionAlt()` - Start session\n- `stopSession()` / `stopSessionAlt()` - Stop session\n- `logoutSession()` / `logoutSessionBulk()` - Logout session\n- `restartSession()` - Restart session\n- `getSessionMe()` - Get session \"me\" info\n\n### 🆔 Profile Management (5 methods)\n- `getProfile()` - Get my profile\n- `setProfileName()` - Set profile name\n- `setProfileStatus()` - Set profile status\n- `setProfilePicture()` - Set profile picture\n- `deleteProfilePicture()` - Delete profile picture\n\n### 📤 Messaging (24 methods)\n- `sendText()` / `sendTextAlt()` / `sendTextGet()` - Send text message\n- `sendImage()` / `sendImageAlt()` - Send image\n- `sendFile()` / `sendFileAlt()` - Send file\n- `sendVoice()` - Send voice message\n- `sendVideo()` - Send video\n- `sendButtons()` - Send buttons\n- `sendList()` - Send list message\n- `sendPoll()` - Send poll\n- `sendPollVote()` - Vote in poll\n- `sendLocation()` - Send location\n- `sendContactVcard()` - Send contact vCard\n- `sendLinkPreview()` - Send link with preview\n- `sendLinkCustomPreview()` - Send link with custom preview\n- `forwardMessage()` - Forward message\n- `reply()` - Reply to message\n- `replyButton()` - Reply to button\n- `sendSeen()` - Mark as seen\n- `startTyping()` - Start typing indicator\n- `stopTyping()` - Stop typing indicator\n- `reaction()` - React to message\n- `star()` - Star/unstar message\n- `getMessages()` / `getMessagesAlt()` - Get messages\n- `checkNumberStatus()` - Check if number is on WhatsApp\n\n## Migration / Compatibility notes\n\nWe made the client follow the OpenAPI canonical endpoints for sending messages. Concretely:\n\n- The library now uses the documented POST endpoints such as `POST /api/sendText`, `POST /api/sendImage`, `POST /api/sendFile`, `POST /api/sendVoice`, and `POST /api/sendVideo` and includes the required `session` field in the request body when calling those endpoints.\n- Legacy/alternative helpers (for example `sendTextGet()`, `getMessagesAlt()`, `sendTextAlt()`) remain in the client for backwards compatibility but are annotated as deprecated in the source. Prefer the modern methods such as `sendText()` and `getMessages(chatId)`.\n\nIf you previously relied on internal session-prefixed send URLs (e.g. `/api/{session}/messages/text`), update your calls to use the canonical methods above. If you need the library to retain automatic fallback to legacy endpoints (try canonical first, fallback to legacy), tell me and I can add graceful retry/fallback behavior.\n\n### 💬 Chat Management (16 methods)\n- `getChats()` - Get all chats\n- `getChatsOverview()` - Get chats overview\n- `createChatsOverview()` - Create chats overview\n- `deleteChat()` - Delete chat\n- `getChatPicture()` - Get chat picture\n- `getMessage()` - Get specific message\n- `deleteMessage()` - Delete message\n- `editMessage()` - Edit message\n- `deleteAllMessages()` - Delete all messages\n- `readMessages()` - Mark messages as read\n- `pinMessage()` - Pin message\n- `unpinMessage()` - Unpin message\n- `archiveChat()` - Archive chat\n- `unarchiveChat()` - Unarchive chat\n- `markChatUnread()` - Mark chat as unread\n\n### 📢 Channels Management (14 methods)\n- `getChannels()` - Get all channels\n- `createChannel()` - Create channel\n- `getChannel()` - Get channel by ID\n- `deleteChannel()` - Delete channel\n- `getChannelMessagesPreview()` - Get messages preview\n- `followChannel()` - Follow channel\n- `unfollowChannel()` - Unfollow channel\n- `muteChannel()` - Mute channel\n- `unmuteChannel()` - Unmute channel\n- `searchChannelsByView()` - Search channels by view\n- `searchChannelsByText()` - Search channels by text\n- `getChannelSearchViews()` - Get search views\n- `getChannelSearchCountries()` - Get search countries\n- `getChannelSearchCategories()` - Get search categories\n\n### 🟢 Status Management (6 methods)\n- `postTextStatus()` - Post text status\n- `postImageStatus()` - Post image status\n- `postVoiceStatus()` - Post voice status\n- `postVideoStatus()` - Post video status\n- `deleteStatus()` - Delete status\n- `getNewMessageId()` - Get new message ID\n\n### 🏷️ Labels Management (7 methods)\n- `getLabels()` - Get all labels\n- `createLabel()` - Create label\n- `updateLabel()` - Update label\n- `deleteLabel()` - Delete label\n- `getChatLabels()` - Get labels for chat\n- `setChatLabels()` - Set labels for chat\n- `getChatsByLabel()` - Get chats by label\n\n### 👤 Contacts Management (12 methods)\n- `getAllContacts()` - Get all contacts\n- `getContact()` - Get contact info\n- `checkContactExists()` - Check if contact exists\n- `getContactAbout()` - Get contact about\n- `getContactProfilePicture()` - Get contact profile picture\n- `blockContact()` - Block contact\n- `unblockContact()` - Unblock contact\n- `updateContact()` - Update contact\n- `getLids()` - Get LIDs\n- `getLidsCount()` - Get LIDs count\n- `getLid()` - Get LID by ID\n- `getLidByPhone()` - Get LID by phone\n\n### 👥 Groups Management (25 methods)\n- `createGroup()` - Create group\n- `getGroups()` - Get all groups\n- `getGroup()` - Get group by ID\n- `deleteGroup()` - Delete group\n- `getGroupsCount()` - Get groups count\n- `refreshGroups()` - Refresh groups\n- `getGroupJoinInfo()` - Get group join info\n- `joinGroup()` - Join group\n- `leaveGroup()` - Leave group\n- `getGroupPicture()` - Get group picture\n- `setGroupPicture()` - Set group picture\n- `deleteGroupPicture()` - Delete group picture\n- `setGroupDescription()` - Set group description\n- `setGroupSubject()` - Set group subject\n- `getGroupInfoAdminOnly()` - Get info admin only setting\n- `setGroupInfoAdminOnly()` - Set info admin only\n- `getGroupMessagesAdminOnly()` - Get messages admin only setting\n- `setGroupMessagesAdminOnly()` - Set messages admin only\n- `getGroupInviteCode()` - Get invite code\n- `revokeGroupInviteCode()` - Revoke invite code\n- `getGroupParticipants()` - Get participants\n- `addGroupParticipants()` - Add participants\n- `removeGroupParticipants()` - Remove participants\n- `promoteGroupParticipant()` - Promote to admin\n- `demoteGroupParticipant()` - Demote from admin\n\n### ✅ Presence Management (4 methods)\n- `setPresence()` - Set presence\n- `getAllPresence()` - Get all presence info\n- `getPresence()` - Get presence for chat\n- `subscribePresence()` - Subscribe to presence\n\n### 🔍 Observability (9 methods)\n- `ping()` - Ping endpoint\n- `health()` - Health check\n- `getVersion()` - Get API version\n- `getServerVersion()` - Get server version\n- `getServerEnvironment()` - Get server environment\n- `getServerStatus()` - Get server status\n- `stopServer()` - Stop server\n- `getHeapSnapshot()` - Get heap snapshot\n- `getBrowserTrace()` - Get browser trace\n\n### 🖼️ Media Management (2 methods)\n- `convertToVoice()` - Convert audio to voice format\n- `convertVideo()` - Convert video\n\n### 🖼️ Screenshot (1 method)\n- `takeScreenshot()` - Take screenshot\n\n### 📅 Events (1 method)\n- `sendEvent()` - Send event\n\n### 🧩 Apps Management (6 methods)\n- `getApps()` - Get all apps\n- `createApp()` - Create app\n- `getApp()` - Get app by ID\n- `updateApp()` - Update app\n- `deleteApp()` - Delete app\n- `getChatwootLocales()` - Get Chatwoot locales\n\n## Usage Examples\n\n### Send Text Message\n\n```typescript\nawait client.sendText({\n  chatId: '1234567890@c.us',\n  text: 'Hello, World!',\n  reply_to: 'message-id',  // Optional: Reply to a specific message\n  config: { ... },          // Optional: Override config\n});\n```\n\n### Send Image\n\n```typescript\nawait client.sendImage({\n  chatId: '1234567890@c.us',\n  file: 'https://example.com/image.jpg', // URL or base64\n  caption: 'Check this out!',             // Optional\n  reply_to: 'message-id',                 // Optional\n  config: { ... },                        // Optional\n});\n```\n\n### Send File\n\n```typescript\nawait client.sendFile({\n  chatId: '1234567890@c.us',\n  file: 'https://example.com/document.pdf',\n  filename: 'document.pdf',               // Optional\n  caption: 'Important document',          // Optional\n  reply_to: 'message-id',                 // Optional\n  config: { ... },                        // Optional\n});\n```\n\n### Create and Manage Groups\n\n```typescript\n// Create a group\nconst groupResponse = await client.createGroup({\n  name: 'My Group',\n  participants: ['1234567890@c.us', '0987654321@c.us']\n});\n\n// Add participants (use the group ID from the response)\nconst groupId = 'group-id@g.us'; // Extract from response\nawait client.addGroupParticipants(groupId, {\n  participants: ['1111111111@c.us']\n});\n\n// Promote to admin\nawait client.promoteGroupParticipant(groupId, {\n  participants: ['1234567890@c.us']\n});\n```\n\n### Session Management\n\n#### Get Session Info\n\n```typescript\nconst session = await client.getSession({\n  session: 'custom-session',  // Optional: Override session\n});\n```\n\n#### Start Session\n\n```typescript\nconst session = await client.startSession({\n  session: 'new-session',  // Optional: Override session to start\n});\n```\n\n#### Stop Session\n\n```typescript\nawait client.stopSession({\n  session: 'session-to-stop',  // Optional: Override session\n});\n```\n\n#### Get All Sessions\n\n```typescript\nconst sessions = await client.getSessions();\n```\n\n### Chat Operations\n\n#### Get Chats\n\n```typescript\nconst chats = await client.getChats({\n  session: 'custom-session',  // Optional: Override session\n});\n```\n\n#### Get Messages\n\n```typescript\nconst messages = await client.getMessages('1234567890@c.us', {\n  session: 'custom-session',  // Optional: Override session\n});\n```\n\n### Contact Operations\n\n#### Check Number Status\n\n```typescript\nconst status = await client.checkNumberStatus('1234567890', {\n  session: 'custom-session',  // Optional: Override session\n});\nconsole.log(status.exists); // true if number is on WhatsApp\n```\n\n## Advanced Usage\n\n### Multiple Sessions\n\nYou can work with multiple WhatsApp sessions using the same client:\n\n```typescript\nconst client = new WAHAClient({\n  baseURL: 'https://your-waha-instance.com',\n  apiKey: 'your-api-key',\n  session: 'default',\n});\n\n// Send from default session\nawait client.sendText({\n  chatId: '1234567890@c.us',\n  text: 'From default session',\n});\n\n// Send from a different session\nawait client.sendText({\n  chatId: '1234567890@c.us',\n  text: 'From custom session',\n  config: { session: 'session-2' },\n});\n```\n\n### Custom Retry Logic\n\nAdjust retry behavior for specific operations:\n\n```typescript\n// For a critical message that needs more retries\nawait client.sendText({\n  chatId: '1234567890@c.us',\n  text: 'Important message',\n  config: {\n    retryAttempts: 10,\n    retryDelay: 5000,\n  },\n});\n\n// For a quick operation with no retries\nawait client.sendText({\n  chatId: '1234567890@c.us',\n  text: 'Quick message',\n  config: {\n    retryAttempts: 0,\n  },\n});\n```\n\n### Error Handling\n\n```typescript\ntry {\n  await client.sendText({\n    chatId: '1234567890@c.us',\n    text: 'Hello!',\n  });\n} catch (error) {\n  console.error('Failed to send message:', error);\n}\n```\n\n## Types\n\nThe library exports TypeScript types for all configurations and responses:\n\n```typescript\nimport type {\n  WAHAConfig,\n  RequestConfig,\n  SendTextParams,\n  SendImageParams,\n  SendFileParams,\n  SessionInfo,\n  ChatInfo,\n  MessageInfo,\n  APIResponse,\n} from 'waha-api-client-ts';\n```\n\n## Examples\n\nSee [src/example.ts](./src/example.ts) for code examples and [src/demo.ts](./src/demo.ts) for a complete feature demonstration.\n\nTo run the demo:\n```bash\nnpm install\nnpx tsx src/demo.ts\n```\n\n### Viewing Documentation\n\nOnce deployed, the API documentation will be available at:\n- **GitHub Pages**: `https://myusp.github.io/waha-api-client-ts/`\n\nYou can also generate documentation locally:\n```bash\nnpm run docs\n# Documentation will be generated in the ./docs directory\n```\n\n## License\n\nISC\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Disclaimer\n\nThis is an unofficial client library for WAHA API. It is not affiliated with or endorsed by the WAHA project.\n\n**USE AT YOUR OWN RISK**: This software is provided \"as is\" without warranty of any kind, either expressed or implied. The authors and contributors are not responsible for any damages, data loss, account bans, or other issues that may arise from using this library. You are solely responsible for ensuring your use complies with WhatsApp's Terms of Service and applicable laws. By using this library, you acknowledge and accept all risks associated with automated messaging and API usage.\n","readmeFilename":"README.md"}