/whatsapp-cloud.js

library to interact with Whatsapp's Cloud API

Primary LanguageTypeScript

Whatsapp Cloud JS

Whatsapp Cloud JS is a library to allows you to interact with Whatsapp's Cloud API

🚀 Getting started

import { Client } from 'whatsapp-cloud.js'

const client = new Client({
  auth: {
    accessToken: process.env.ACCESS_TOKEN,
    phoneNumberID: process.env.PHONE_NUMBER_ID,
  },
});

client.on("message", async (message) => {
    await client.messages.sendTextMessage(
        `Did you said "${message.text}"?`,
        message.from
    );
});

client.initializeWebhook(3000).then(() => {
  console.log("Ready!");
});

💡 Documentation

You can find the documentation at https://thallesp.github.io/whatsapp-cloud.js (docs in beta).
You can find examples at the examples folder.

📋 TODO

[x] - Ability to send text messages
[x] - Finish HTTP server to receive Whatsapp events
[x] - Ability to send template messages
[x] - Ability to send reply buttons
[x] - Ability to send sections
[] - Ability to send media messages