Module middleware

Description

Simplify the setup proccess of WhatsAppAPI for different frameworks.

Example

import WhatsAppAPI from "whatsapp-api-js/middleware/deno";

const Whatsapp = new WhatsAppAPI({
token: "YOUR_TOKEN",
appSecret: "YOUR_APP_SECRET"
});

Deno.serve(async (req) => {
if (req.method === "POST") {
const status = await Whatsapp.handle_post(req);
return new Response(null, { status });
} else if (req.method === "GET") {
const challenge = Whatsapp.handle_get(req);
return new Response(challenge);
}
});

See

Index

Classes

Generated using TypeDoc