go-notificationgo-notification
Channels/SMS

Vonage (Nexmo)

Vonage API — formerly Nexmo. Similar to Twilio, solid global coverage.

Vonage (previously Nexmo) is a direct Twilio competitor. Similar coverage, similar pricing. Some regions are cheaper on Vonage, others on Twilio — worth comparing if you're at scale.

Pricing

Setup

  1. Create an account at https://vonage.com.
  2. Copy API key and API secret from the dashboard.
  3. Optionally buy a sender number; some countries also allow alphanumeric senders.
main.go
import "github.com/gopackx/go-notification/channel/sms/vonage"

notifier.RegisterChannel("sms", vonage.New(vonage.Config{
    APIKey:    os.Getenv("VONAGE_API_KEY"),
    APISecret: os.Getenv("VONAGE_API_SECRET"),
    From:      "YourBrand", // or +E.164 number, country-dependent
}))

Configuration reference

FieldTypeRequiredDescription
APIKeystringyesVonage API key.
APISecretstringyesVonage API secret. Rotate on compromise.
FromstringyesSender ID — alphanumeric (where allowed) or E.164 number.
Timeouttime.DurationnoHTTP timeout per send. Default: 30s.

Fallback pattern

A common high-reliability setup: Twilio as primary, Vonage as backup.

main.go
notifier.RegisterChannel("sms",         twilio.New(/* ... */))
notifier.RegisterChannel("sms-backup",  vonage.New(/* ... */))

func (n OTP) Via(u notification.Notifiable) []string {
    return []string{"sms"}
}

// In your OnError handler, trigger a retry via "sms-backup"

Troubleshooting

  • delivery-status: Undeliverable — country/carrier block. Try a different sender type (short code vs alphanumeric).
  • Alphanumeric sender rejected — US and Canada don't allow alphanumeric senders. Use a proper long code or toll-free.
  • Billing surprise — some countries (Russia, parts of the Middle East) are 10× typical per-message cost. Check the rate sheet before rolling out.