Back to docs

WhatsApp bot starter (Twilio)

Deploy a production-ready WhatsApp bot in minutes using Twilio's Messaging API. Auto-reply, webhook handling, and sandbox testing included.

Prerequisites

  • A Twilio account with an active phone number
  • Node.js 18+ and npm installed
  • ngrok or similar tunnel for local webhook testing

Quick start

npx create-meridian-app@latest my-whatsapp-bot --template whatsapp-twilio
cd my-whatsapp-bot
npm install
cp .env.example .env
# Fill in TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_PHONE_NUMBER
npm run dev

Webhook setup

  1. Start ngrok: ngrok http 3000
  2. Copy the HTTPS forwarding URL
  3. In Twilio Console, set the WhatsApp sandbox webhook to https://your-ngrok.ngrok.io/api/webhook
  4. Send a message to your Twilio sandbox number to test

What's included

Auto-reply engine

Keyword matching and fallback responses out of the box.

Webhook validation

Twilio signature verification for every incoming request.

Environment config

All secrets managed via .env, never committed.

Deploy ready

One-click deploy to Vercel or Railway with zero config changes.