SMS OTPs get lost to carrier filtering and routing gaps — and cost you per message. WhatsApp codes arrive in seconds over data, in every major market, with no carrier fees. One POST per code.
SMS OTP delivery fails more than you'd think — carrier filtering, international routing gaps, and SIM-swap attacks make SMS a weak link in your auth flow. WhatsApp has near-universal penetration in most markets and delivers instantly over data, not the carrier network.
WABridges lets you send verification codes to any WhatsApp number from your backend in one API call. No template pre-approval, no per-message fee, no carrier relationship required.
I want to send OTP verification codes via WhatsApp using WABridges
instead of SMS.
My stack: [Node.js / Python / Ruby — update this]
My setup:
- WA_API_KEY: my WABridges API key
- Bridge customer_ref: "verify"
- I use Redis for ephemeral key storage (or tell me an alternative)
I need:
1. A sendOtp(phoneNumber) function that:
- Generates a 6-digit code
- Stores it in Redis with a 10-minute TTL, keyed by phone number
- Sends it via WABridges with a friendly message like:
"Your verification code is: 483920. Expires in 10 minutes."
2. A verifyOtp(phoneNumber, code) function that:
- Looks up the stored code
- Returns true/false and deletes the key on success
- Rate-limits to 5 attempts (decrement a counter, block on 0)
Please read the WABridges API docs before writing:
https://wabridges.com/llms-full.txt
Keep it framework-agnostic — just the two functions. Add a note on
how to swap Redis for a database column if needed.