zaileys 4.8.0 → 4.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +40 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -27,13 +27,14 @@
27
27
 
28
28
  <div align="center">
29
29
  <p>
30
- <b>Zaileys</b> is a type-safe wrapper around <a href="https://github.com/WhiskeySockets/Baileys">Baileys</a> that makes building WhatsApp bots feel effortless. Create a <code>Client</code>, listen for typed events, and send anything from plain text to interactive buttons and rich AI-style responses with a single chainable builder authentication, reconnection, and storage are handled for you.
30
+ <b>Zaileys</b> is a type-safe WhatsApp framework for Node.js &amp; TypeScript with <b>two providers behind one API</b>: the <b>unofficial</b> WhatsApp Web engine (<a href="https://github.com/WhiskeySockets/Baileys">Baileys</a>) and the <b>official Meta WhatsApp Cloud API</b>. Write your bot once against a single chainable builder and typed events then run it on either provider by flipping one option. Authentication, reconnection, and storage are handled for you.
31
31
  </p>
32
32
  </div>
33
33
 
34
34
  <div align="center">
35
35
 
36
36
  [Quick start](#quick-start) &nbsp;•&nbsp;
37
+ [Providers](#two-providers-one-api) &nbsp;•&nbsp;
37
38
  [Why Zaileys](#why-zaileys) &nbsp;•&nbsp;
38
39
  [Install](#install) &nbsp;•&nbsp;
39
40
  [What you can build](#what-you-can-build) &nbsp;•&nbsp;
@@ -77,6 +78,43 @@ Prefer a pairing code? Provide your number:
77
78
  const client = new Client({ authType: 'pairing', phoneNumber: '6281234567890' })
78
79
  ```
79
80
 
81
+ ## Two providers, one API
82
+
83
+ Zaileys runs on **either** the unofficial WhatsApp Web engine **or** the **official Meta WhatsApp Cloud API** — same `Client`, same `send(jid)…` builder, same typed events. Switch with one option; your handlers never change.
84
+
85
+ ```typescript
86
+ // 🔗 Unofficial (default) — WhatsApp Web via Baileys. QR/pairing login, groups, polls, channels.
87
+ const client = new Client()
88
+
89
+ // ☁️ Official — Meta Cloud API. Token auth, no ban risk, templates/OTP/campaigns, Flows, commerce.
90
+ const client = new Client({
91
+ provider: 'cloud',
92
+ cloud: {
93
+ accessToken: process.env.WA_TOKEN!,
94
+ phoneNumberId: process.env.WA_PHONE_ID!,
95
+ verifyToken: process.env.WA_VERIFY!,
96
+ appSecret: process.env.WA_APP_SECRET!,
97
+ },
98
+ })
99
+
100
+ client.on('text', (m) => m.reply(`echo: ${m.text}`))
101
+ await client.sendTemplate('628xxx', 'welcome', 'en_US') // cloud-only: reach users who never texted you
102
+
103
+ // inbound arrives via webhook (framework-agnostic) — mount on any server:
104
+ export const GET = client.webhook()
105
+ export const POST = client.webhook()
106
+ ```
107
+
108
+ | | 🔗 Unofficial (WhatsApp Web) | ☁️ Official (Meta Cloud API) |
109
+ | --- | --- | --- |
110
+ | Login | QR / pairing code, no approval | Permanent token |
111
+ | Ban risk | Exists | None (sanctioned) |
112
+ | Groups / channels / polls | ✅ | ❌ |
113
+ | Templates / OTP / marketing | ❌ | ✅ |
114
+ | Message users who never texted you | ✅ any number | ✅ via approved templates |
115
+
116
+ Pick your provider → **[Choose Your Provider](https://zeative.github.io/zaileys/providers)** · **[Official Cloud API guide](https://zeative.github.io/zaileys/official)**.
117
+
80
118
  ## Build with AI
81
119
 
82
120
  Zaileys ships an **official Agent Skill suite** so your AI assistant writes, reviews, and
@@ -96,6 +134,7 @@ The suite has an orchestrator that auto-routes plus focused scaffold, debug, and
96
134
 
97
135
  ## Why Zaileys
98
136
 
137
+ - **Two providers, one codebase** — the unofficial WhatsApp Web engine and the official Meta Cloud API behind the same `Client`. Switch with a single option; your handlers never change.
99
138
  - **Typed events** — `on('text' | 'image' | 'reaction' | 'button-click' | 'group-update' | …)` with fully-typed payloads and IntelliSense. No raw Baileys decoding, no `any`.
100
139
  - **One chainable builder** — `client.send(jid).text(…).reply(quoted).mentions([…])` resolves to the sent message key when awaited.
101
140
  - **Rich & interactive out of the box** — native buttons, lists, carousels, and Meta-AI-style rich responses written as plain markdown.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zaileys",
3
3
  "description": "Zaileys - Simplified WhatsApp Node.js TypeScript/JavaScript API",
4
- "version": "4.8.0",
4
+ "version": "4.8.2",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",