whatsapp-cloud.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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 document messages

Readme

Keywords

none

Package Sidebar

Install

npm i whatsapp-cloud.js

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

11.5 kB

Total Files

4

Last publish

Collaborators

  • thallesp