Public
Like
untitled-3191
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
A web application that can handle incoming WhatsApp messages and send automated replies on your behalf.
- Web interface to configure auto-reply settings
- Webhook endpoint to receive WhatsApp messages
- Automated response system with customizable messages
- Message history and analytics
- Support for different reply modes (always, business hours, away message)
-
WhatsApp Business API Setup:
- Sign up for WhatsApp Business API through Meta Business
- Get your access token and phone number ID
- Set webhook URL to:
https://your-val-url.web.val.run/webhook
-
Environment Variables: Set these in your Val Town environment:
WHATSAPP_ACCESS_TOKEN
: Your WhatsApp Business API access tokenWHATSAPP_PHONE_NUMBER_ID
: Your WhatsApp Business phone number IDWEBHOOK_VERIFY_TOKEN
: A secret token for webhook verification
-
Webhook Configuration:
- URL:
https://your-val-url.web.val.run/webhook
- Verify Token: Use the same value as
WEBHOOK_VERIFY_TOKEN
- Subscribe to:
messages
events
- URL:
├── backend/
│ ├── index.ts # Main Hono server
│ ├── database/
│ │ ├── migrations.ts # Database schema
│ │ └── queries.ts # Database operations
│ └── routes/
│ ├── webhook.ts # WhatsApp webhook handler
│ ├── api.ts # API routes for frontend
│ └── static.ts # Static file serving
├── frontend/
│ ├── index.html # Main web interface
│ ├── index.tsx # React app entry point
│ └── components/
│ ├── App.tsx # Main app component
│ ├── Dashboard.tsx # Settings dashboard
│ └── MessageHistory.tsx # Message history view
└── shared/
└── types.ts # Shared TypeScript types
- Access the web interface to configure your auto-reply settings
- Set up your WhatsApp Business API webhook
- Messages will be automatically replied to based on your configuration
- Monitor message history and analytics through the dashboard
GET /
- Web interfacePOST /webhook
- WhatsApp webhook endpointGET /webhook
- Webhook verificationGET /api/settings
- Get current settingsPOST /api/settings
- Update settingsGET /api/messages
- Get message history