Skip to content

Raw sends

client.messages.sendRaw(body, options?) posts any body to {phoneNumberId}/messages and adds messaging_product: 'whatsapp' if you leave it out. Use it for message shapes Meta has released before this SDK has a typed sender. The body is not validated client-side. Retries, timeouts and errors work as for the other senders, and you can declare the response type.

const result = await client.messages.sendRaw<{ messages: { id: string }[] }>({
to: '15551234567',
type: 'text',
text: { body: 'Hello' },
});

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.