0.0.13 • Published 11 months ago

@chatally/whatsapp-cloud v0.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@chatally/whatsapp-cloud

WhatsApp Cloud Server is a ChatAlly server that integrates the WhatsApp endpoints Webhooks, Messages and Media into one ChatAlly module.

This package is meant to be used within a ChatAlly chatbot application.

Usage

Install the required packages

npm install @chatally/core @chatally/whatsapp-cloud

Create a main module, that sets up the WhatsApp cloud server and integrates it with your ChatAlly application.

import { Application } from '@chatally/core'
import { WhatsAppCloud } from './lib/index.js'

const phoneNumberId = 'YOUR PHONE NUMBER'
const accessToken = 'YOUR ACCESS TOKEN'
const verifyToken = 'YOUR WEBHOOKS VERIFY TOKEN'
const secret = 'YOUR WEBHOOKS VALIDATION SECRET'

const whatsapp = new WhatsAppCloud({
  env: false, // do not read configuration from environment variables
  file: false, // do not read configuration from default configuration files
  graphApi: { phoneNumberId, accessToken },
  webhooks: { verifyToken, secret },
})

new Application() //
  .use(whatsapp)
  .use(({ req, res }) => {
    if (res.isWritable) {
      res.write(`You said '${req.content}' and I don't know what it means.`)
    }
  })
  .listen()

Documentation

Find the full documentation at https://chatally.org/reference/servers/whatsapp-cloud.

0.0.11

11 months ago

0.0.12

11 months ago

0.0.13

11 months ago

0.0.10

11 months ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago