@messagebird/sdk 0.5.0 → 0.7.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 +15 -0
- package/dist/index.d.mts +674 -94
- package/dist/index.mjs +301 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,6 +64,21 @@ for await (const message of bird.email.list()) {
|
|
|
64
64
|
}
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
## WhatsApp
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
await bird.whatsapp.send({ to, template }); // resolves when accepted (202); Bird picks the sender from the template's category
|
|
71
|
+
await bird.whatsapp.get(messageId); // delivery status + failure detail
|
|
72
|
+
|
|
73
|
+
// `await` yields the first page; `for await` walks every message across pages.
|
|
74
|
+
for await (const message of bird.whatsapp.list()) {
|
|
75
|
+
console.log(message.id);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const { data } = await bird.whatsapp.listEvents(messageId); // full lifecycle timeline, not paginated
|
|
79
|
+
const { data: templates } = await bird.whatsappTemplates.list(); // the workspace's Meta-approved templates
|
|
80
|
+
```
|
|
81
|
+
|
|
67
82
|
## Webhooks
|
|
68
83
|
|
|
69
84
|
`unwrap` verifies a delivery's Standard Webhooks signature and returns a typed, discriminated event. **Pass the raw request body** — never the parsed JSON. Set the signing secret once via `webhooks: { secret }` on the client (or pass `{ secret }` per call).
|