meta-cloud-api 3.8.0 → 3.9.0
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.
- package/README.md +19 -3
- package/dist/index.d.mts +649 -236
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/node/chunk.mjs +1 -0
- package/dist/node/index.d.mts +10393 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.mjs +23 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/testing/index.d.ts +377 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/node/index.js +3 -0
- package/dist/types/index.d.ts +203 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +264 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/node/index.d.ts +682 -0
- package/dist/utils/node/index.d.ts.map +1 -0
- package/dist/utils/node/index.js +16 -0
- package/dist/utils/node/index.js.map +1 -0
- package/package.json +31 -6
package/README.md
CHANGED
|
@@ -62,11 +62,13 @@ await wa.messages.image({ to: '1234567890', link: 'https://example.com/image.png
|
|
|
62
62
|
| Account ban risk | None | None | Yes — violates WhatsApp ToS |
|
|
63
63
|
| Maintenance | Active (tracks OpenAPI v23) | **Archived since 2023** | Varies |
|
|
64
64
|
| TypeScript | Strict, full request/response types | Partial | Varies |
|
|
65
|
-
| API coverage |
|
|
66
|
-
| Webhook adapters | Built-in Express.js
|
|
65
|
+
| API coverage | 22 modules (Messages, Flows, Calling, Payments, and more) | Messaging-focused | Personal-account features |
|
|
66
|
+
| Webhook adapters | Built-in Express.js, Next.js, Hono, Fastify (NestJS via Express) | Manual | Custom event system |
|
|
67
67
|
|
|
68
68
|
If you're building on the official Cloud API and don't want to bet on an unmaintained SDK, this is what the archived one would look like if Meta had kept shipping it.
|
|
69
69
|
|
|
70
|
+
**Coming from the `whatsapp` package?** The [migration guide](https://meta-cloud-api.site/getting-started/migrate-from-whatsapp-nodejs-sdk) maps every API of the archived SDK (config, messages, templates, webhooks, errors) to meta-cloud-api, with a checklist.
|
|
71
|
+
|
|
70
72
|
## API Coverage
|
|
71
73
|
|
|
72
74
|
```
|
|
@@ -89,6 +91,9 @@ wa.blockUsers // Block/unblock users
|
|
|
89
91
|
wa.contactBook // Delete a BSUID contact book entry
|
|
90
92
|
wa.threadControl // Conversation Routing: pass, release, take threads
|
|
91
93
|
wa.waba // WhatsApp Business Account management
|
|
94
|
+
wa.business // Business portfolio, pre-verified phone numbers, owned/client WABAs, credit lines
|
|
95
|
+
wa.messageHistory // Message history and history events
|
|
96
|
+
wa.solutions // Multi-Partner Solutions management
|
|
92
97
|
```
|
|
93
98
|
|
|
94
99
|
## Webhooks
|
|
@@ -133,11 +138,22 @@ app.get('/webhook', Whatsapp.GET);
|
|
|
133
138
|
app.post('/webhook', Whatsapp.POST);
|
|
134
139
|
```
|
|
135
140
|
|
|
141
|
+
Other frameworks use the same handler object (`GET`, `POST`, `webhook`, `flow`, `processor`, `destroy`):
|
|
142
|
+
|
|
143
|
+
| Framework | Adapter | Guide |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| Express.js | `expressWebhookHandler` | [Express](https://meta-cloud-api.site/guides/express/) |
|
|
146
|
+
| Next.js App Router | `nextjsAppWebhookHandler` | [Next.js App Router](https://meta-cloud-api.site/guides/nextjs-app/) |
|
|
147
|
+
| Next.js Pages Router | `nextjsPagesWebhookHandler` | [Next.js Pages Router](https://meta-cloud-api.site/guides/nextjs-pages/) |
|
|
148
|
+
| Hono (Node.js, Bun, Deno, Workers, Edge) | `honoWebhookHandler` | [Hono](https://meta-cloud-api.site/guides/hono/) |
|
|
149
|
+
| Fastify | `fastifyWebhookHandler` | [Fastify](https://meta-cloud-api.site/guides/fastify/) |
|
|
150
|
+
| NestJS | `expressWebhookHandler` or `fastifyWebhookHandler` | [NestJS](https://meta-cloud-api.site/guides/nestjs/) |
|
|
151
|
+
|
|
136
152
|
All 30+ webhook field types are supported — messages, statuses, templates, flows, groups, calls, and more. See the [Webhooks documentation](https://meta-cloud-api.site/) for the full list of handlers.
|
|
137
153
|
|
|
138
154
|
## Requirements
|
|
139
155
|
|
|
140
|
-
- **Node.js**
|
|
156
|
+
- **Node.js** 20.12+, **Bun**, **Deno**, **Cloudflare Workers** or **Vercel Edge** — no runtime dependencies, no `node:*` imports ([runtime guide](https://meta-cloud-api.site/guides/runtimes))
|
|
141
157
|
- **TypeScript** 4.5+ (for TypeScript projects)
|
|
142
158
|
|
|
143
159
|
## Resources
|