createWhatsAppLink
function createWhatsAppLink(phone, message?): string | null;Defined in: whatsapp.ts:12
Creates a WhatsApp click-to-chat link for a Pakistani mobile number.
Accepts local, international, and short phone formats.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
phone |
string |
Pakistani mobile number in any supported format |
message? |
string |
Optional pre-filled message (URL-encoded) |
Returns
Section titled “Returns”string | null
WhatsApp wa.me link, or null if the phone number is invalid