Tendkit

Search documentation

Find a docs page

Get Started

WhatsApp Cloud API

WhatsApp Business directly with Meta.

Install

Terminal
npx shadcn@latest add @tendkit/channel-whatsapp

It lands in lib/support/channels/. Import whatsappChannel from there.

Set up

  1. Create a Meta app

    Type Business, with the WhatsApp product, and add your business number.

  2. Create a System User token

    Business settings → System users. Assign the app and WhatsApp account, and generate a token with whatsapp_business_messaging and whatsapp_business_management.

  3. Register the webhook

    App → WhatsApp → Configuration: callback URL = the channel's webhook URL, verify token = your verifyToken; subscribe to messages. Meta verifies with a GET, so export GET from your route too.

  4. Add a payment method

    Meta charges replies per message after a monthly free tier, and stops delivering them when the tier runs out without one.

Configure

lib/support/index.ts
whatsappChannel({
  id: "whatsapp",
  phoneNumberId: process.env.WA_PHONE_NUMBER_ID!,
  accessToken: process.env.WA_ACCESS_TOKEN!,
  appSecret: process.env.WA_APP_SECRET!,
  verifyToken: process.env.WA_VERIFY_TOKEN!,
  displayNumber: "+1 415 555 0133",
})

Options

NameTypeDescription
id*stringStable channel id, stored on every ticket and used in the webhook URL. Never change it.
phoneNumberId*stringThe business number's id, not the number itself.
accessToken*stringA System User token.
appSecret*stringApp settings → Basic. Signs webhook deliveries.
verifyToken*stringAny string; Meta echoes it when you register the webhook.
displayNumber*stringThe number customers write to, for display.
apiVersionstringGraph API version.

Behaviour

  • Replies are allowed for 24 hours after the customer's last message; this adapter doesn't send templates.
  • Reactions and system notices are ignored, so they never reopen a ticket.