WhatsApp SDK

Send WhatsApp messages directly from your app.

Written By despia

Last updated About 1 year ago

SDK Usage

// Send to specific number
window.despia = `whatsapp://send?phone=+1234567890&text=Hello!`

// Or let user choose contact
window.despia = `whatsapp://send?text=Hello!`

Examples

Send Simple Message

const message = "Let's connect!"
window.despia = `whatsapp://send?text=${message}`

Message Specific Number

const phone = "+1234567890"
const message = "Your order is ready!"
window.despia = `whatsapp://send?phone=${phone}&text=${message}`

Share Dynamic Content

const productName = "Cool Product"
const price = "$99"
const message = `Check out ${productName} for ${price}!`
window.despia = `whatsapp://send?text=${message}`

Tips

  • Phone numbers need country code (e.g., +1 for USA)

  • Encode special characters in messages

  • Test both with and without phone numbers

  • Messages open in WhatsApp for user confirmation


Need help? Email us at support@despia.com