Meta Cloud API is designed to be easy to integrate with your existing Node.js applications, with a clean and intuitive TypeScript interface.
From simple text to interactive buttons, templates, media sharing and more - build rich conversational experiences with WhatsApp.
Built with TypeScript to provide code completion, parameter validation, and to catch errors during development - not at runtime.
import Whatsapp from 'meta-cloud-api';
// Initialize the client
const client = new Whatsapp({
accessToken: process.env.ACCESS_TOKEN,
phoneNumberId: process.env.PHONE_NUMBER_ID,
version: '22'
});
// Send a WhatsApp message
const response = await client.messages.send({
to: '+1234567890',
type: 'text',
text: {
body: 'Hello from Meta Cloud API!'
}
});
console.log(response);